Click here to Skip to main content
6,634,665 members and growing! (15,119 online)
Email Password   helpLost your password?
Languages » C++ / CLI » General     Intermediate

Convert Currency to Words in English & French

By _duk_

Convert a given currency in English & French with American style digital grouping.
C++/CLI, VC7, .NET, WinXP, Win2003, Visual Studio, Dev
Posted:2 Sep 2005
Views:27,533
Bookmarked:5 times
Unedited contribution
Announcements
Loading...
 
Search    
Advanced Search
Add to IE Search
printPrint   add Share
      Discuss Discuss   Broken Article?Report  
4 votes for this article.
Popularity: 0.60 Rating: 1.00 out of 5
4 votes, 100.0%
1

2

3

4

5

Sample Image - Convert_Currency_to_Words.jpg

Introduction

The conversion of Currency Number to Words program is most needed in commercial applications. The source code is following American practice. It means that digits are grouped into three digits each.

Background

This function is in Managed C++ and is based on the knowledge base article of Microsoft.

Using the code

Since the function is written in Managed C++. The C++ software developers can reuse this source code.

How it works

The function is named as ConvertCurrencyToEnglish. This accepts a parameter of type pointer String. First the function checks the existence of decimal in the number passed as parameter. If decimal exists it constructs the word for cents. After removing the decimal digits from the number it converts digits, tens and hundreds by using routine ConvertDigits, ConvertTens and ConvertHundreds respectively. It contract and returns a string containing the number in words with dollars and cents as prefix and suffix. Likewise French also.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

_duk_


Member

Location: Russian Federation Russian Federation

Other popular C++ / CLI articles:

Article Top
You must Sign In to use this message board.
FAQ FAQ 
 
Noise Tolerance  Layout  Per page   
 Msgs 1 to 3 of 3 (Total in Forum: 3) (Refresh)FirstPrevNext
GeneralMy vote of 1 PinmemberAlexandre GRANVAUD22:59 27 Oct '09  
GeneralC# 2.0 version PinmemberBob Vandehey9:34 13 Jan '07  
Newsunmanaged version... PinmemberJeremy Falcon9:52 2 Sep '05  

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

PermaLink | Privacy | Terms of Use
Last Updated: 2 Sep 2005
Editor:
Copyright 2005 by _duk_
Everything else Copyright © CodeProject, 1999-2009
Web19 | Advertise on the Code Project