Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / July 2007

Tip: Looking for answers? Try searching our database.

Integer Number -> Text Number

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
news.microsoft.com - 26 Jul 2007 20:25 GMT
All,

I have a form that currently displays an integer value in a label to a user
but want it to now display the text equivalent.  For example, if I have 54,
it should say fifty four.  Any class examples on doing this or should I just
do it with a case function?  Not to be picky, but....Ideas in VB would be
best.

Thanks,
Brian
Jesse Houwing - 26 Jul 2007 22:31 GMT
* news.microsoft.com wrote, On 26-7-2007 21:25:
> All,
>
[quoted text clipped - 3 lines]
> do it with a case function?  Not to be picky, but....Ideas in VB would be
> best.

I don't think there is something like this in the base class library.
You might be lucky in the Speech SDK though. In order to pronounce a
number, it must be parsed correctly. But it's a long shot.

A case statement might work for most numbers, but would need quite a few
exceptions I guess. At least in different languages than English. (Frech
comes to mind, Dutch also has quite a few specifics).

Jesse
Morten Wennevik [C# MVP] - 27 Jul 2007 08:25 GMT
> All,
>
[quoted text clipped - 6 lines]
> Thanks,
> Brian

Hi Brian,

There are no premade classes that will do this for you, which means you need to custom make it yourself (or use a third party component).  In any case, this will probably break any globalization of your application.  If you only need English translation this won't be a problem.

The articles below demonstrates the principles of such a translation.

http://www.blackwasp.co.uk/NumberToWords.aspx
http://www.vb-helper.com/howto_number_to_words.html

Signature

Happy coding!
Morten Wennevik [C# MVP]


Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.