Digital conversion to Chinese capital

xiaoxiao2021-04-03  214

// Module: Digital Conversion to Chinese Capital #include "stdafx.h" static char * Unit1 [] = {"Pick", "", "仟"}; static char * unit2 [] = {"10,000", " 100 million "}; static char * Digital [] = {" zero "," 壹 "," "," "," "," Wu "," 柒 "," 捌 "," 玖 " "}; // function: Convert the data within 10 into characters, string and reading // long level [in]: Data to be converted // char * buf [out]: Character output // Note: Internal function//*********************************************** ******* Static void getlext (long Level, char * buf) {int digit; bool bprezero = false; Bool Bzerodide = false; int i = 0; int Unit = -1; while (level) {Digit = Level% 10; if (Digit) {if (bprezero && bzerodate) {strat (buf, digital [0]); i = 2;} if (unit! = - 1) // BUF [i ] = unit1 [unit]; / / unit {strat (buf, unit1 [unit]); i = 2;} strcat (buf, digital [digit]); i = 2; bprezero = false; bzerodate = true;} else {bprezero = true;} unit ; Level / = 10;} BUF [i] = 0;} // ****************************************** ****** ******************** // Function: Data Convert to Chinese Character // Long Num [in]: Data to be converted // char * buf [out]: Character output // return value: true- conversion success, FALSE- failed, data exceeded processing range // ************************************ ****************************************** BOOL NUM2UPDIGIT (long Num, Char * BUF) {Long Level1, Level2, Level3; Char Level1BUF [17] = {0}, Level2buf [17] = {0}, Level3buf [17] = {0}; int P = 0; Level1 = Num% 10000; Num / = 1000; Level2 = Num% 10000; Num / = 10000; Level3 = NUM;

转载请注明原文地址:https://www.9cbs.com/read-131637.html

New Post(0)