A function of Arabic numerals to Chinese numerals, Arabic Chinese
Recently, because of the need, wrote a "Arabic numerals to Chinese numbers function." The search for the essence area saw a similar one. I feel my algorithm is good, so paste it out to share if you want to use for the amount of conversion, the number of parts of the processing to do a change function Ch_num ($num, $mode =true) { $char = Array ("0", "one", "II", "three", "the", "WU", "Lu", "Qi", "ba", "JIU"); $DW = Array ("", "Pick", "Bai", "Thousand", "" "," Million "," Yi "," Mega "); $dec = "dot"; $retval = ""; if ($mode) Preg_match_all ("/^0* (\d*) \.?" (\d*)/", $num, $ar); Else Preg_match_all ("/(\d*) \.? (\d*)/", $num, $ar); if ($ar [2][0]! = "") $retval = $dec. Ch_num ($ar [2][0],false); If there are decimals, the decimal is first processed recursively if ($ar [1][0]! = "") { $str = Strrev ($ar [1][0]); for ($i =0; $i $out [$i] = $char [$STR [$i]]; if ($mode) { $out [$i]. = $STR [$i]! = "0"? $DW [$i%4]: ""; if ($str [$i]+ $str [$i-1] = = 0) $out [$i] = ""; if ($i%4 = = 0) $out [$i]. = $DW [4+floor ($i/4)]; } } $retval = Join ("", Array_reverse ($out)). $retval; } return $retval; } Echo ch_num ("12345006789001.123"); Echo ch_num ("880079.1234"); Echo ch_num ("300045.0123"); ?>
|
|
|
Detailed Description: http://php.662p.com/thread-364-1-1.html
Excel 2010 How to turn Arabic numerals into Chinese capital numbers? (no functions, no tools to convert directly)
Right-click the cell, select Format cells,
On the left of the Number tab, select Special, and on the right, select Chinese capital digits
In Excel, how to convert the numbers represented in Chinese to Arabic numerals??
Without this direct approach, you have to look at the rules of your data to decide what functions to use to help. Please give an example, detailed, if not, please pass the file to analyze.
http://www.bkjia.com/PHPjc/834764.html www.bkjia.com true http://www.bkjia.com/PHPjc/834764.html techarticle a function of Arabic numerals to Chinese numerals, Arabic Chinese has recently written a function of Arabic numerals to Chinese numerals. The search for the essence area saw a similar one. Sense ...