Application scenario:
When the document is played, the Chinese capital is displayed on the bill.
Development environment:
Crystal Report 9
solution:
In order to display Chinese capitalized renminbi in Crytal Report, we can use formula fields to change the value amount.
1) Assume that there is a field in the ticket:
¥ × 10 × 千 × 百 × 拾 × 元
Add formula fields in each x position.
2) Edit the formula of the formula field, as follows
'This is the formula of a 10,000 formula field
DIM DESC AS STRING
DESC = "Zero Zibo Wei Lu Lu"
DIM CNINDEX AS Number
'Get the corresponding 10,000 digits
CNINDEX = INT ({Amount} / 10000)
'Get the corresponding capital renminbi
Formula = DESC (CNINDEX 1)
3) The basic idea of this algorithm is to obtain the number of the bit, and then obtain the characters of the corresponding Chinese capital of the renminbi by numbers.