The number of a crystal report is converted into a Chinese capital formula!

xiaoxiao2021-03-06  54

Stringvar x;

Stringvar xx: = ""

Numbervar z;

Numbervar i;

x: = TOTEXT ({Cl_cfkb.fkje});

X: = Left (x, length (x) -5); // The number below this is the value of the number of digits after the decimal point plus 1

// I am now stored 4 digits after the decimal point, so it can only be accurate to a bit.

x: = Replace (x, ",", "");

Z: = Length (x);

For i: = z to 1 step -1 do

(

SELECT I

Case 8: IF (MID (X, Z-I 1, 1) <> "0") THEN XX: = MID (X, Z-I 1, 1) "Ten"

Case 7: IF (MID (X, Z-I 1, 1) <> "0") THEN XX: = XX MID (X, Z-I 1, 1) "100 million" ELSE XX: = XX "100 million"

Case 6: IF (MID (X, Z-I 1, 1) <> "0") THEN XX: = XX MID (X, Z-I 1, 1) "仟"

Case 5: IF (MID (X, Z-I 1, 1) <> "0") THEN XX: = XX MID (X, Z-I 1, 1) ""

Case 4: IF (MID (X, Z-I 1, 1) <> "0") THEN XX: = XX MID (X, Z-I 1, 1) "Ten"

Case 3: IF (MID (X, Z-I 1, 1) <> "0") THEN XX: = XX MID (X, Z-I 1, 1) "Wan" ELSE XX: = XX "10,000"

Case 2: IF (MID (X, Z-I 1, 1) <> "0") THEN XX: = XX MID (X, Z-I 1, 1) "仟"

Case 1: IF (MID (X, Z-I 1, 1) <> "0") THEN XX: = XX MID (X, Z-i 1, 1) ""

);

XX: = Replace (xx, "1", "");

XX: = Replace (xx, "2", "贰");

XX: = Replace (xx, "3", "叁");

XX: = Replace (xx, "4", "");

XX: = Replace (XX, "5", "Wu");

XX: = Replace (xx, "6", "land");

XX: = Replace (xx, "7", "柒");

XX: = Replace (xx, "8", "捌");

XX: = Replace (xx, "9", "");

XX "Yuan";

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

New Post(0)