473,322 Members | 1,671 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Decimal to Word

Hi,

Does anybody know about any library that can convert a decimal into words.

For example:

decimal d = 34251.78;
string s = DecimalToWord(d) ;

's' should look like "Thirty Four Thousand Two Hundred Fifty One And 78/100"

I need this to for my module that prints checks.

I can write it by myself, but I don't want to re-invent the wheel.

Thanks.

AM
Jun 27 '08 #1
2 2732
Hi,
check this link: http://www.freevbcode.com/ShowCode.Asp?ID=616
It doesnt handle decimals so you'll have to modify the code a bit. Also this
code is written in old vb6. I dont think you'll have any problem running it
in vb.net. In case you need a C# version of this code, either you can port
it, or I would recommend making a simple dll through vb.net and using it in
C#.

Regards,
...ab
http://joehacker.blogspot.com

"Aamir Mahmood" <aa**********@gmail.comwrote in message
news:u1**************@TK2MSFTNGP02.phx.gbl...
Hi,

Does anybody know about any library that can convert a decimal into words.

For example:

decimal d = 34251.78;
string s = DecimalToWord(d) ;

's' should look like "Thirty Four Thousand Two Hundred Fifty One And
78/100"

I need this to for my module that prints checks.

I can write it by myself, but I don't want to re-invent the wheel.

Thanks.

AM
Jun 27 '08 #2
Hi

You might also check out this pseudocode description, which should be easy
to turn into C# code:
http://www.dummies.com/WileyCDA/Dumm...OGRAMMING.html

"Aamir Mahmood" wrote:
Hi,

Does anybody know about any library that can convert a decimal into words.

For example:

decimal d = 34251.78;
string s = DecimalToWord(d) ;

's' should look like "Thirty Four Thousand Two Hundred Fifty One And 78/100"

I need this to for my module that prints checks.

I can write it by myself, but I don't want to re-invent the wheel.

Thanks.

AM
Jun 27 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

21
by: Batista, Facundo | last post by:
Here I send it. Suggestions and all kinds of recomendations are more than welcomed. If it all goes ok, it'll be a PEP when I finish writing/modifying the code. Thank you. .. Facundo
17
by: John Bentley | last post by:
John Bentley: INTRO The phrase "decimal number" within a programming context is ambiguous. It could refer to the decimal datatype or the related but separate concept of a generic decimal number....
6
by: John Bentley | last post by:
John Bentley writes at this level: If we think about our savings accounts then division never comes in (as far as I can see). We deposit and withdraw exact amounts most of the time. Occasionaly...
5
by: bas jaburg | last post by:
Hi, I need to know the regular expression that checks the whether a 1-decimal number has been entered. Also it needs to ok if no trailing number before the decimal dot has been entered So:...
1
by: Guadala Harry | last post by:
What do to about conversion to decimal type when blank is allowed? The situation is this. In the UI there is a textbox into which users can enter a value which is supposed to be a dollar amount....
6
by: Dennis | last post by:
I am trying to align a column in DataGrid so the decimal's match up (not using fixed fonts). Is there anyone who has code for doing this using StringFormat or something else. Thanks. -- Dennis...
3
by: Brian Henry | last post by:
Does anyone know of or know how to convert a COBOL packed decimal in a text file to a decimal that .NET can work with? we are importing Old COBOL data files that have packed data in them and need...
8
by: Rico | last post by:
Hello Everyone, I observed something strange in some quick testing code: void Button1Click(object sender, System.EventArgs e) { CultureInfo culture = new CultureInfo("th-TH", false); ...
3
by: DeZZar | last post by:
Hi All, I have a database that passes form data to both emails and to word documents. The problem I have is that when the email or merge is instructed access only seems to pass the basic...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.