VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Currency to text Conversion

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

Rate Currency to text Conversion

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' 

Download this snippet    Add to My Saved Code

Currency to text Conversion Comments

No comments have been posted about Currency to text Conversion. Why not be the first to post a comment about Currency to text Conversion.

Post your comment

Subject:
Message:
0/1000 characters