by Dasari. Ravi Kumar(r&d teamworks) (2 Submissions)
Category: Miscellaneous
Compatability: Visual Basic 3.0
Difficulty: Unknown Difficulty
Date Added: Wed 3rd February 2021
Rating: (15 Votes)
Converts the Currency to Text. For Ex: 100.90 is converted as one hundred dollars and ninety cents only.
Assumes
Insert a formula field in crystal reports and Paste the Code and replace the
currencyfield in the code with any reportfield whose datatype is currency or
Integer.
Code Returns
String
if right(totext({currencyfield}),2) = '00' then
uppercase(left(towords(truncate({currencyfield}),0)+' ' +'dollars'+' '+ 'only',1)) + right(towords(truncate({currencyfield}),0)+' ' +'dollars' + ' ' + 'only',length(towords(truncate({currencyfield}),0)+' ' + 'dollars' +' '+ 'only') -1)
else
towords(truncate({currencyfield}),0) +' '+'dollars'+' '+ 'and'+' ' +towords(tonumber(right(TOTEXT({currencyfield}),2)),0)+' '+'cents'+ ' ' + 'only'