Link to home
Start Free TrialLog in
Avatar of light_bulb
light_bulbFlag for United States of America

asked on

TField.AsCurrency - How use a different currency symbol than $ ?

Hello,

I'm trying to use TField.AsCurrency, but I want to display an amount in euros, not dollars?  How can I make it use a different currency symbol?  Here's what I have so far:

          Value := dataModule.tblOutput.FieldByName('ExtendedList').AsCurrency;

This always gives me '$100.00' or the like.  I need it just show the amount in euros, or a secondary goal would be to display the number in currency format (2 decimal places) without the currency symbol at all.

Thanks!
Avatar of 2266180
2266180
Flag of United States of America image

use the global variable CurrencyString  to the desired value.
When working with currency I believe by default it uses your locale settings, set:
Control Panel -> Regional and Language Options

***TRY*** this, might work, not sure where it should go, try in your application's main form, else your Project -> View Source.
CurrencyString := 'R$';
ASKER CERTIFIED SOLUTION
Avatar of 2266180
2266180
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Your reaction is not entirely appropriate, it's what they call an "Edit conflict" -- when I posted my solution you had beat me to it - doesn't mean I maliciously copied your solution in an attempt to, well, I don't know.

Secondly, you are correct about R$ but this would have worked anyway. The solution I had looked up used that symbol, so that's what I had copy-pasted in a hurry -- not in a hurry enough I might add since you had already pasted an answer.

You need not fear, you got awarded the points anyway. The OP can see you posted it first.
I've been around for a few years and I've seen too many answers accepted by the question askers where the accepted answer was a "better"/"more details"/"had an example"/etc answer. (and I don't exagerate when I say too many)
it's like I don't have the time to post an example, or just am in a hurry or whatever and somebody comes along and based on my suggestion, makes  a small demo and they get the points (all of them. been there, seen that, again too many times).
and a few times, the question asker admitted they didn't look attentivly to my answer because it did not contain an example of usage.

bleah. anyway, I now have some "weird" policies towards what and how I ask on EE, my "reaction" was just one of those. I don't care about the points. if you look closely, I've got plenty of them. But I do care that if I give a correct answer, I get what is fairly mine. and that is in almost all cases the grade :) this case could have been a points split for all I care, but I have bigger problems than points, and that is askers that don't know/care how to grade.