I need to convert decimal number into words in crystal report. So I created a formula field
ProperCase( ToWords(Truncate(CDbl ({@AmountInDecimal})),0) )+" Only"
Eg: For `@AmountInDecimal =8031.29', the result is the following : Eight thousand thirty one only
Only the integer part gets converted, decimal places are not getting converted.Can anyone help?
currencyvar Original;
currencyvar deci;
Original:={@AmountInDecimal};
deci:= Original- Truncate(Original);
Original:= truncate(Original);
deci:= deci* 100;
if deci= 0 then 'Rupees ' + ToWords (Original,0 ) + ' Only'
else
'Rupees ' + ToWords (Original,0) + ' And Paisa ' + ToWords(deci,0) + ' Only ';