Getting rid of leading US from ofbizCurrency macro

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Getting rid of leading US from ofbizCurrency macro

Leon Torres-2
Hey, how do I get rid of the leading "US" from the output of <@ofbizCurrency>
when it generates "US$10.00"?

- Leon
Reply | Threaded
Open this post in threaded view
|

Re: Getting rid of leading US from ofbizCurrency macro

Scott Gray
Hi Leon

I can't see how you could do it, but have a look in
UtilFormatOut.formatCurrency() and here
http://icu.sourceforge.net/userguide/formatNumbers.html#currency_formatting

Regards
Scott

Leon Torres wrote:
> Hey, how do I get rid of the leading "US" from the output of
> <@ofbizCurrency> when it generates "US$10.00"?
>
> - Leon
>

Reply | Threaded
Open this post in threaded view
|

Re: Getting rid of leading US from ofbizCurrency macro

BJ Freeman
In reply to this post by Leon Torres-2
depends on how deep you want to go into ofbiz.

if you have just one page you want to change, you could just comment out
the line and make a new line with out
ofbizCurrency

or  you can add a substring function in the bsh file and call it instead
of <@ofbizCurrency>

or you could make a screen widget for the page and not use ofbizCurrency.

or you could go to
framework/webapp/src/org/ofbiz/webapp/ftl/OfbizCurrencyTransform.java
and change the code.




Leon Torres sent the following on 8/8/2006 4:03 PM:
> Hey, how do I get rid of the leading "US" from the output of
> <@ofbizCurrency> when it generates "US$10.00"?
>
> - Leon
>
Reply | Threaded
Open this post in threaded view
|

Re: Getting rid of leading US from ofbizCurrency macro

BJ Freeman
missed one
you can change the class load  for ofbizCurrency
in
FreeMarkerWorker.java

BJ Freeman sent the following on 8/9/2006 5:35 AM:

> depends on how deep you want to go into ofbiz.
>
> if you have just one page you want to change, you could just comment out
> the line and make a new line with out
> ofbizCurrency
>
> or  you can add a substring function in the bsh file and call it instead
> of <@ofbizCurrency>
>
> or you could make a screen widget for the page and not use ofbizCurrency.
>
> or you could go to
> framework/webapp/src/org/ofbiz/webapp/ftl/OfbizCurrencyTransform.java
> and change the code.
>
>
>
>
> Leon Torres sent the following on 8/8/2006 4:03 PM:
>> Hey, how do I get rid of the leading "US" from the output of
>> <@ofbizCurrency> when it generates "US$10.00"?
>>
>> - Leon
>>
>
Reply | Threaded
Open this post in threaded view
|

Re: Getting rid of leading US from ofbizCurrency macro

Leon Torres-2
Well I had to dig in and look at UtilFormatOut.formatCurrency.

It's using the ICU4j formatter to generate the currency.  The strange thing is
when I write a test class to compare the difference between that NumberFormatter
and the default Java one, I don't see a difference.  They both print "$10.00".
   But somehow in my ofbiz the number comes out "US$10.00".

Anyone know why this is?   I found a currency format string in
general.properties "##0.00" but playing with this doesn't fix the problem.

What is causing ICU4j to print "US$10.00" instead of "$10.00" like it's supposed to?

- Leon
Reply | Threaded
Open this post in threaded view
|

Re: Getting rid of leading US from ofbizCurrency macro

David E Jones-2

Probably the locale. The same currency will display differently in  
different locales with most such libraries, even the ones that come  
with the standard Java API.

-David


On Aug 9, 2006, at 4:15 PM, Leon Torres wrote:

> Well I had to dig in and look at UtilFormatOut.formatCurrency.
>
> It's using the ICU4j formatter to generate the currency.  The  
> strange thing is when I write a test class to compare the  
> difference between that NumberFormatter and the default Java one, I  
> don't see a difference.  They both print "$10.00".   But somehow in  
> my ofbiz the number comes out "US$10.00".
>
> Anyone know why this is?   I found a currency format string in  
> general.properties "##0.00" but playing with this doesn't fix the  
> problem.
>
> What is causing ICU4j to print "US$10.00" instead of "$10.00" like  
> it's supposed to?
>
> - Leon