472,374 Members | 1,089 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Formatting Currency

How is everyone formatting currency with VB.NET?

Before I was calling the API function for it, which took the currency
symbol from the Windows settings. I've found this to be limited when
working with European countries where business in conducted in several
different currencies. Are you guys just storing a currency symbol and
formatting the number accordingly? What about the comma and decimal
switch that some locales use?

I hope .NET makes this easy for me! :-)

--
- Mitchell Vincent
- kBilling - Invoices Made Easy!
- http://www.k-billing.com
Nov 21 '05 #1
4 1918
I would say you are better off storing a list of currency codes, symbols,
and decimal places for each currency. I don't think windows settings can
keep up with different currencies, what countries are using which ones, etc.

This also means, that when whatever after .NET comes out, your port will be
easy. You won't have to figure out how to do this in some other framework.

"Mitchell Vincent" <mv******@newsgroup.nospam> wrote in message
news:Oz****************@tk2msftngp13.phx.gbl...
How is everyone formatting currency with VB.NET?

Before I was calling the API function for it, which took the currency
symbol from the Windows settings. I've found this to be limited when
working with European countries where business in conducted in several
different currencies. Are you guys just storing a currency symbol and
formatting the number accordingly? What about the comma and decimal switch
that some locales use?

I hope .NET makes this easy for me! :-)

--
- Mitchell Vincent
- kBilling - Invoices Made Easy!
- http://www.k-billing.com

Nov 21 '05 #2
Mitchell.

The currency difference in the States in Europe is now probably not more
than in America.The oldest 6 EU states plus Ireland, Greece, Spain,
Portugal, Finland, and Austria use the Euro.

In the local settings of the computer are the currencies, and when you do it
right you have almost nothing to do.

There are only two states in Europe that uses a point as decimal point
separator the UK and Ireland. (The same as in America, beside all the States
of the US and English speaking Canada).

However normally there is nothing to do for it, it is a part of the Net and
the OS.

Look for it especially to the overloading ToString and the numberformatinfo

http://msdn.microsoft.com/library/de...classtopic.asp

I hope this helps,

Cor

..
Nov 21 '05 #3
Mitchell Vincent wrote:
How is everyone formatting currency with VB.NET?

Before I was calling the API function for it, which took the currency
symbol from the Windows settings. I've found this to be limited when
working with European countries where business in conducted in several
different currencies. Are you guys just storing a currency symbol and
formatting the number accordingly? What about the comma and decimal
switch that some locales use?

I hope .NET makes this easy for me! :-)


For future reference :

Dim Price as Double = 10.00

Debug.Writeline(String.Format("{0:c}", Price)

Does it!

--
- Mitchell Vincent
- kBilling - Invoices Made Easy!
- http://www.k-billing.com
Nov 21 '05 #4
Hi

Thanks for your experience sharing.
If you still have any concern, please feel free to post here.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 21 '05 #5

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

Similar topics

6
by: Colin Fox | last post by:
Hi, all. This feels like a stupid question to me, but I've scoured the Internet (yes, the whole thing! :) and I can't find a single example of using the locale module to format money. So I...
16
by: Douglas | last post by:
Gday, How would I format a number so that: TheValue = 32500 Displays in the TextBox as: $32,500.00
3
by: Vlad | last post by:
Hi, I am trying to display a currency value formated according to the current culture in ASP.NET: decimal x = 125345.54M; string currencyString = String.Format("{0:c}",x); what gets retured is...
6
by: Brad | last post by:
I guess I still have not grasped the logic of formatting a simple label or text box. Why would the following not work? I need the resulting label to display currency. lblAmtDue.Text =...
8
by: G.Ashok | last post by:
Hi, I have created CultureInfo object and specified required digit grouping in it. The one of the overloaded ToString methods of Decimal type has parameters to format the value with required...
14
by: Scott M. | last post by:
Ok, this is driving me nuts... I am using VS.NET 2003 and trying to take an item out of a row in a loosely-typed dataset and place it in a label as a currency. As it is now, I am getting my...
1
by: scoarescoare | last post by:
I am running into a problem that I cannot seem to solve. I'm using ADO.NET 2.0 with vb 2005. I have a dataset as a datasource that selects all of the Shoe_Types from a Shoe_Type table. I am...
9
by: john coltrane | last post by:
Is there way to create a formatted string in a similar that is similar to sprintf? The same for printing, printf? C,D,E,F,G,N,X for currency, decimal, exponential, fixed, general, numerical,...
18
by: maxpirate | last post by:
The currency values are displayed in format of the regional settings specified in the computer of the user. I would like to display all the currency values in dollar format irrespective of the...
2
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
2
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...
0
by: jack2019x | last post by:
hello, Is there code or static lib for hook swapchain present? I wanna hook dxgi swapchain present for dx11 and dx9.
0
DizelArs
by: DizelArs | last post by:
Hi all) Faced with a problem, element.click() event doesn't work in Safari browser. Tried various tricks like emulating touch event through a function: let clickEvent = new Event('click', {...
0
by: F22F35 | last post by:
I am a newbie to Access (most programming for that matter). I need help in creating an Access database that keeps the history of each user in a database. For example, a user might have lesson 1 sent...

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.