| 订阅 | 在线投稿
分享
 
 
当前位置: 王朝网络 >> delphi >> jin e da xie zhuan huan

jin e da xie zhuan huan

2006-12-17 07:38:25 编辑來源:互联网 评论
 
 
 
本文为【金额大写转换】的拼音翻译版
  jin e da xie zhuan huan
  
  jin e da xie zhuan huan yin wei zhao bu dao xiang guan han shu , bian zi ji xie le yi ge , shi fang Excel jin e zhuan huan , bu xian jin e chang du 。
  const
  NumberArray: array[0..9] of string =
   (' ling ', ' yi ',' er ',' san ',' si ',' wu ',' lu ',' qi ',' ba ',' jiu ');
  // shu zi zhuan yu da xie
  function GetMoneySwitch(AMoney: string): string;
  // qu chu suo you fen ge fu
  procedure ClearComma(var AValue: string);
  begin
   while Pos(',', AValue) > 0 do
   Delete(AValue, Pos(',', AValue), 1);
  end;
  // ce shi ru guo wei ling jiang bu fan hui zhi
  function FiltrateValue(const AValue, AStr: string): string;
  var
   IntValue: Integer;
  begin
   IntValue:= StrToIntDef(AValue, 0);
   if IntValue > 0 then Result:= AStr;
  end;
  // zhi jie jiang shu zi fan yi cheng da xie
  function Direct(const AValue: string): string;
  var
   ResultStr: string;
   iCount: Integer;
  begin
   for iCount:= 1 to Length(AValue) do
   ResultStr:= ResultStr + NumberArray[StrToInt(AValue[iCount])];
   Result:= ResultStr;
  end;
  // jiang si wei chang du de shu zi fan yi yu da xie
  function FourBit(const AValue: string): string;
  var
   i, x, j: Integer;
   IntValue: Integer;
   ResultStr: string;
  begin
   IntValue:= StrToIntDef(AValue, 0);
   x:= IntValue;
   i := x div 1000;
   j := x mod 1000;
   if i <> 0 then ResultStr:= NumberArray[i] + ' qian '
   else begin
   if Length(AValue) > 3 then ResultStr:= ' ling ';
   end;
   i := j div 100;
   j := j mod 100;
   if i <> 0 then ResultStr:= ResultStr + NumberArray[i] + ' bai '
   else begin
   if (ResultStr <> '') and (Length(AValue) > 2) and
   (Copy(ResultStr, Length(ResultStr)-1, 2) <> ' ling ') then
   ResultStr:= ResultStr + ' ling ';
   end;
   i := j div 10;
   j := j mod 10;
   if i <> 0 then ResultStr := ResultStr + NumberArray[i] + ' shi '
   else begin
   if (ResultStr <> '') and (Length(AValue) > 1) and
   (Copy(ResultStr, Length(ResultStr)-1, 2) <> ' ling ') then
   ResultStr:= ResultStr + ' ling ';
   end;
   ResultStr := ResultStr + NumberArray[j];
   while Copy(ResultStr, Length(ResultStr)-1, 2) = ' ling ' do
   Delete(ResultStr, Length(ResultStr)-1, 2);
   Result := ResultStr;
  end;
  var
  IntegerValue: string; // zheng shu bu fen de zhi
  KilomegaValue: string; // cun chu da yu qian zhao de shu zi
  AccountValue: string; // zai qian zhao yi nei de zheng shu bu fen
  DecimalValue: string; // cun zai xiao shu dian hou de zhi
  ResultKilomega: string; // da yu qian zhao bing fan yi hou de da xie zi fu
  ResultAccount: string; // zai qian zhao yi nei de zheng shu bu fen bing fan yi hou de da xie zi fu
  ResultDecimal: string; // xiao shu dian hou de zhi bing fan yi hou de da xie zi fu
  FourBitStr: string; // zui da si wei zhi de zi fu
  begin
  // qing chu fen ge fu
  ClearComma(AMoney);
  // yan zheng zi fu chuan shi fou he fa
  try
   AMoney:= FloatToStr(StrToFloat(AMoney));
  except
   raise Exception.Create(' wu xiao de shu zhi zi fu chuan ');
  end;
  // qu dao xiao shu ju dian hou de zhi
  // qu chu zheng shu bu fen de zhi
  if Pos('.', AMoney) > 0 then
  begin
   DecimalValue:= Copy(AMoney, Pos('.', AMoney) + 1, Length(AMoney));
   IntegerValue:= Copy(AMoney, 0, Pos('.', AMoney)-1);
   ResultDecimal:= '.' + Direct(DecimalValue);
  end
  else IntegerValue:= AMoney;
  // qu dao da yu qian zhao de shu zi
  // qu dao zai qian zhao yi nei de zheng shu bu fen
  if Length(IntegerValue) > 16 then
  begin
   KilomegaValue:= Copy(IntegerValue, 0, Length(IntegerValue) - 12);
   AccountValue:= Copy(IntegerValue,
   Length(IntegerValue) - 11, Length(IntegerValue));
   ResultKilomega:= Direct(KilomegaValue) + ' zhao ';
  end
  else AccountValue:= IntegerValue;
  { fan yi zai qian zhao yi nei de zheng shu bu fen }
  // fan yi zai zhao yu qian zhao zhi jian de bu fen
  if Length(AccountValue) > 12 then
  begin
   FourBitStr:= Copy(AccountValue, 0, Length(AccountValue) - 12);
   ResultAccount:= ResultAccount +
   FourBit(FourBitStr) + FiltrateValue(FourBitStr, ' zhao ');
   Delete(AccountValue, 1, Length(AccountValue) - 12);
  end;
  // fan yi zai yi yu qian yi zhi jian de bu fen
  if Length(AccountValue) >= 8 then
  begin
   FourBitStr:= Copy(AccountValue, 0, Length(AccountValue) - 8);
   ResultAccount:= ResultAccount +
   FourBit(FourBitStr) + FiltrateValue(FourBitStr, ' yi ');
   Delete(AccountValue, 1, Length(AccountValue) - 8);
  end;
  // fan yi zai wan yu qian wan zhi jian de bu fen
  if Length(AccountValue) >= 5 then
  begin
   FourBitStr:= Copy(AccountValue, 0, Length(AccountValue) - 4);
   ResultAccount:= ResultAccount +
   FourBit(FourBitStr) + FiltrateValue(FourBitStr, ' wan ');
   Delete(AccountValue, 1, Length(AccountValue) - 4);
  end;
  // fan yi wan yi xia de bu fen
  if Length(AccountValue) > 0 then
  begin
   ResultAccount:= ResultAccount +
   FourBit(Copy(AccountValue, 0, Length(AccountValue)));
  end;
  // zu he zi fu chuan
  Result:= ResultKilomega + ResultAccount + ResultDecimal;
  end;【原文】【汉音对照
 
 
 
 
 
 
 
 
 
日版宠物情人插曲《Winding Road》歌词

日版宠物情人2017的插曲,很带节奏感,日语的,女生唱的。 最后听见是在第8集的时候女主手割伤了,然后男主用嘴帮她吸了一下,插曲就出来了。 歌手:Def...

兄弟共妻,我成了他们夜里的美食

老钟家的两个儿子很特别,就是跟其他的人不太一样,魔一般的执着。兄弟俩都到了要结婚的年龄了,不管自家老爹怎么磨破嘴皮子,兄弟俩说不娶就不娶,老父母为兄弟两操碎了心...

如何磨出破洞牛仔裤?牛仔裤怎么剪破洞?

把牛仔裤磨出有线的破洞 1、具体工具就是磨脚石,下面垫一个硬物,然后用磨脚石一直磨一直磨,到把那块磨薄了,用手撕开就好了。出来的洞啊很自然的。需要猫须的话调几...

我就是扫描下图得到了敬业福和爱国福

先来看下敬业福和爱国福 今年春节,支付宝再次推出了“五福红包”活动,表示要“把欠大家的敬业福都还给大家”。 今天该活动正式启动,和去年一样,需要收集“五福”...

冰箱异味产生的原因和臭味去除的方法

有时候我们打开冰箱就会闻到一股异味,冰箱里的这种异味是因为一些物质发出的气味的混合体,闻起来让人恶心。 产生这些异味的主要原因有以下几点。 1、很多人有这种习...

 
 
jin e da xie zhuan huan jin e da xie zhuan huan yin wei zhao bu dao xiang guan han shu , bian zi ji xie le yi ge , shi fang Excel jin e zhuan huan , bu xian jin e chang du 。 const NumberArray: array[0..9] of string = (' ling ', ' yi ',' er ',' san ',' si ',' wu ',' lu ',' qi ',' ba ',' jiu '); // shu zi zhuan yu da xie function GetMoneySwitch(AMoney: string): string; // qu chu suo you fen ge fu procedure ClearComma(var AValue: string); begin while Pos(',', AValue) > 0 do Delete(AValue, Pos(',', AValue), 1); end; // ce shi ru guo wei ling jiang bu fan hui zhi function FiltrateValue(const AValue, AStr: string): string; var IntValue: Integer; begin IntValue:= StrToIntDef(AValue, 0); if IntValue > 0 then Result:= AStr; end; // zhi jie jiang shu zi fan yi cheng da xie function Direct(const AValue: string): string; var ResultStr: string; iCount: Integer; begin for iCount:= 1 to Length(AValue) do ResultStr:= ResultStr + NumberArray[StrToInt(AValue[iCount])]; Result:= ResultStr; end; // jiang si wei chang du de shu zi fan yi yu da xie function FourBit(const AValue: string): string; var i, x, j: Integer; IntValue: Integer; ResultStr: string; begin IntValue:= StrToIntDef(AValue, 0); x:= IntValue; i := x div 1000; j := x mod 1000; if i <> 0 then ResultStr:= NumberArray[i] + ' qian ' else begin if Length(AValue) > 3 then ResultStr:= ' ling '; end; i := j div 100; j := j mod 100; if i <> 0 then ResultStr:= ResultStr + NumberArray[i] + ' bai ' else begin if (ResultStr <> '') and (Length(AValue) > 2) and (Copy(ResultStr, Length(ResultStr)-1, 2) <> ' ling ') then ResultStr:= ResultStr + ' ling '; end; i := j div 10; j := j mod 10; if i <> 0 then ResultStr := ResultStr + NumberArray[i] + ' shi ' else begin if (ResultStr <> '') and (Length(AValue) > 1) and (Copy(ResultStr, Length(ResultStr)-1, 2) <> ' ling ') then ResultStr:= ResultStr + ' ling '; end; ResultStr := ResultStr + NumberArray[j]; while Copy(ResultStr, Length(ResultStr)-1, 2) = ' ling ' do Delete(ResultStr, Length(ResultStr)-1, 2); Result := ResultStr; end; var IntegerValue: string; // zheng shu bu fen de zhi KilomegaValue: string; // cun chu da yu qian zhao de shu zi AccountValue: string; // zai qian zhao yi nei de zheng shu bu fen DecimalValue: string; // cun zai xiao shu dian hou de zhi ResultKilomega: string; // da yu qian zhao bing fan yi hou de da xie zi fu ResultAccount: string; // zai qian zhao yi nei de zheng shu bu fen bing fan yi hou de da xie zi fu ResultDecimal: string; // xiao shu dian hou de zhi bing fan yi hou de da xie zi fu FourBitStr: string; // zui da si wei zhi de zi fu begin // qing chu fen ge fu ClearComma(AMoney); // yan zheng zi fu chuan shi fou he fa try AMoney:= FloatToStr(StrToFloat(AMoney)); except raise Exception.Create(' wu xiao de shu zhi zi fu chuan '); end; // qu dao xiao shu ju dian hou de zhi // qu chu zheng shu bu fen de zhi if Pos('.', AMoney) > 0 then begin DecimalValue:= Copy(AMoney, Pos('.', AMoney) + 1, Length(AMoney)); IntegerValue:= Copy(AMoney, 0, Pos('.', AMoney)-1); ResultDecimal:= '.' + Direct(DecimalValue); end else IntegerValue:= AMoney; // qu dao da yu qian zhao de shu zi // qu dao zai qian zhao yi nei de zheng shu bu fen if Length(IntegerValue) > 16 then begin KilomegaValue:= Copy(IntegerValue, 0, Length(IntegerValue) - 12); AccountValue:= Copy(IntegerValue, Length(IntegerValue) - 11, Length(IntegerValue)); ResultKilomega:= Direct(KilomegaValue) + ' zhao '; end else AccountValue:= IntegerValue; { fan yi zai qian zhao yi nei de zheng shu bu fen } // fan yi zai zhao yu qian zhao zhi jian de bu fen if Length(AccountValue) > 12 then begin FourBitStr:= Copy(AccountValue, 0, Length(AccountValue) - 12); ResultAccount:= ResultAccount + FourBit(FourBitStr) + FiltrateValue(FourBitStr, ' zhao '); Delete(AccountValue, 1, Length(AccountValue) - 12); end; // fan yi zai yi yu qian yi zhi jian de bu fen if Length(AccountValue) >= 8 then begin FourBitStr:= Copy(AccountValue, 0, Length(AccountValue) - 8); ResultAccount:= ResultAccount + FourBit(FourBitStr) + FiltrateValue(FourBitStr, ' yi '); Delete(AccountValue, 1, Length(AccountValue) - 8); end; // fan yi zai wan yu qian wan zhi jian de bu fen if Length(AccountValue) >= 5 then begin FourBitStr:= Copy(AccountValue, 0, Length(AccountValue) - 4); ResultAccount:= ResultAccount + FourBit(FourBitStr) + FiltrateValue(FourBitStr, ' wan '); Delete(AccountValue, 1, Length(AccountValue) - 4); end; // fan yi wan yi xia de bu fen if Length(AccountValue) > 0 then begin ResultAccount:= ResultAccount + FourBit(Copy(AccountValue, 0, Length(AccountValue))); end; // zu he zi fu chuan Result:= ResultKilomega + ResultAccount + ResultDecimal; end;
󰈣󰈤
  免责声明:本文仅代表作者个人观点,与王朝网络无关。王朝网络登载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述,其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
 
情人节的清纯女生(9)
情人节的清纯女生(8)
情人节的清纯女生(7)
情人节的清纯女生(6)
山东蓬莱海边组照
一探哲蚌 II
一探哲蚌 III
古长城的一角
 
>>返回首页<<
 
 
 为你推荐
 
 
 
 转载本文
 UBB代码 HTML代码
复制到剪贴板...
 
 热帖排行
 
 
 
 
 
©2005- 王朝网络 版权所有