Important alert: (current site time 7/16/2013 3:55:14 AM EDT)
 

VB icon

Currency to text Conversion

Email
Submitted on: 12/9/1999
By: Dasari. Ravi Kumar(r&d teamworks)  
Level: Not Given
User Rating: By 15 Users
Compatibility: VB 4.0 (16-bit), VB 4.0 (32-bit), VB 5.0, VB 6.0
Views: 26788
 
     Converts the Currency to Text. For Ex: 100.90 is converted as one hundred dollars and ninety cents only.
 
code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
 
Terms of Agreement:   
By using this code, you agree to the following terms...   
  1. You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.
				
'**************************************
' Name: Currency to text Conversion
' Description:Converts the Currency to Text. For Ex: 100.90 is converted as one hundred dollars and ninety cents only.
' By: Dasari. Ravi Kumar(r&d teamworks)
'
' Returns:String
'
' 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.
'
'This code is copyrighted and has' limited warranties.Please see http://www.Planet-Source-Code.com/vb/scripts/ShowCode.asp?txtCodeId=4804&lngWId=1'for details.'**************************************

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' 


Other 2 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Not Given category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments
12/9/1999 1:17:00 AMRony

It Works Amazingly and I feel it is
100% original. Keep It up.
(If this comment was disrespectful, please report it.)

 
12/9/1999 1:20:00 AMSam

It Works Nicely. I think it is a
enhancement of Towords function of reports.Good work.
(If this comment was disrespectful, please report it.)

 
12/9/1999 1:29:00 AMAnil

ur code works out to be fantastic...

(If this comment was disrespectful, please report it.)

 
12/9/1999 1:32:00 AMshanker

this function is I think first of its kind extending towords function.
(If this comment was disrespectful, please report it.)

 
12/9/1999 2:20:00 AMSimren

I find your code absolutely working. I
desperately needed a function in reports
to convert the currency to text.
Thanx Man
(If this comment was disrespectful, please report it.)

 
12/9/1999 2:22:00 AMEric


Not Bad.
(If this comment was disrespectful, please report it.)

 
12/9/1999 2:25:00 AMAuthor

I am extremely greatful to the
Planet Source code for giving me a chance to submit my own code.Some more
functions are yet to come.
(If this comment was disrespectful, please report it.)

 
12/10/1999 9:05:00 AMMohit

Nice function.
This functionality is provided by a built in function in Crystal Reports- with something like curTotext operator.
(If this comment was disrespectful, please report it.)

 
12/12/1999 11:39:12 PMJames

Pretty Useful in reports. i hope u will develop a function in vb also
(If this comment was disrespectful, please report it.)

 
12/12/1999 11:47:01 PMGuna

Good formula. Iused in making Payrolls.
Thanks
(If this comment was disrespectful, please report it.)

 
12/13/1999 12:11:50 AMGibbs

nice formula...
(If this comment was disrespectful, please report it.)

 
12/13/1999 12:19:13 AMsiler

rk ur formula is not bad....
(If this comment was disrespectful, please report it.)

 
1/2/2000 3:08:54 PMGohar

Q. How can I print from date to
to date using Crystal report?
(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.