Ccc realize the conversion of Arabic numerals in RMB into words

From , 5 Years ago, written in C#, viewed 195 times.
URL https://pastebin.vip/view/eeaebbff
  1. void Main()
  2. {
  3.      
  4.       Console.WriteLine("{0,14:N2}: {1}", 102, ConvertToChinese(102));
  5.      
  6. }
  7.  static string ConvertToChinese(double x)
  8.   {
  9.     string s = x.ToString("#L#E#D#C#K#E#D#C#J#E#D#C#I#E#D#C#H#E#D#C#G#E#D#C#F#E#D#C#.0B0A");
  10.     string d = Regex.Replace(s, @"((?<=-|^)[^1-9]*)|((?'z'0)[0A-E]*((?=[1-9])|(?'-z'(?=[F-L.]|$))))|((?'b'[F-L])(?'z'0)[0A-L]*((?=[1-9])|(?'-z'(?=[.]|$))))", "${b}${z}");
  11.     return Regex.Replace(d, ".", delegate(Match m) { return "负元空零壹贰叁肆伍陆柒捌玖空空空空空空空分角拾佰仟萬億兆京垓秭穰"[m.Value[0] - '-'].ToString(); });
  12.   }
  13.    
  14. //  102.00: 壹佰零贰元
  15. //csharp/6772

Reply to "Ccc realize the conversion of Arabic numerals in RMB into words"

Here you can reply to the paste above

captcha

https://burned.cc - Burn After Reading Website