Monday, May 24, 2010

C# routine to write out check amounts?

I'm looking for a routine to format a dollar amount in textual form as would be written long-form on a check. For example, given the value 123.45, I want the routine to return "One hundred twenty-three dollars and 45 cents" or something similar. Does anyone know of some existing public source code for this so I can avoid writing it from scratch?





Routine needs to work under .NET 2.0, preferably in C#.

C# routine to write out check amounts?
Check out this webpage. http://www.vbdotnetheaven.com/UploadFile...





It is in VB but it is not hard to convert it to C#.
Reply:i would parse the number and seperate by the .


the front i would read 1 number at a time from where the . is


append the next number front and have a counter to tell where im at so it starts at 0 it knows its in the one place if its in the counter%3 = 1 then its in the teen - twenty... if its 1 then read the number before and remove that word if its 0 just increase counter ... kinda like that


No comments:

Post a Comment