主要代码如下:
private void button1_Click(object sender, EventArgs e)
        
{
            String[] Scale 
= """""""""""""""""""""亿""""""""""""""" };
            String[] Base 
= """""""""""""""""""" };
            String Temp 
= textBox1.Text.ToString();
            String Info 
= null;
            
int index = Temp.IndexOf("."0, Temp.Length);//判断是否有小数点
            if (index != -1)
            
{
                Temp 
= Temp.Remove(Temp.IndexOf("."), 1);
                
for (int i = Temp.Length; i > 0; i--)
                
{
                    
int Data = Convert.ToInt16(Temp[Temp.Length - i]);
                    Info 
+= Base[Data - 48];
                    Info 
+= Scale[i - 1];
                }

            }

            
else
            
{
                
for (int i = Temp.Length; i > 0; i--)
                
{
                    
int Data = Convert.ToInt16(Temp[Temp.Length - i]);
                    Info 
+= Base[Data - 48];
                    Info 
+= Scale[i + 1];
                }

            }

            textBox2.Text 
= Info;
        }
posted on 2007-12-30 00:31  Travelling  阅读(313)  评论(1编辑  收藏  举报