[ic] Currencies and PayPal

Paco Sánchez interchange-users@icdevgroup.org
Fri Jan 17 17:56:00 2003


>
> Did you try with
>
> [tmp noformat_cost][total-cost noformat=1][/tmp]
>

Hello Joachim, thanks for your reply.

Bases on your suggestion I have developed the following formula:

[tmp noformat_cost][calc](int([total-cost
noformat=1]*100)+1)/100[/calc][/tmp]

Since your original idea results in a number with several decima places when
changing currencies (for example 14.493284543), I have done this to cut
decimals to only two (14.49 in the example).  However, there is still a
problem with this.  Sometimes, if, say, you get something like 14.70, it is
shown as 14.7, which results in a failure at the Paypal page, as they
require two decimals formatting.  Any ideas on how to resolve this?

> and work with
>
> [if scratch mv_locale =~ /en_US/]
> do something ...etc.
>

At this point I have used the following:

[if scratch mv_currency =~ /en_US/]<input type="hidden" name="currency_code"
value="USD">
[elsif scratch mv_currency =~ /eur_EUR/]<input type="hidden"
name="currency_code" value="EUR">[/elsif][/if]

which works fine.  Thanks for the tip.

Best regards.

Paco Sánchez
http://pacosanchez.com
mailto:psanchez%40pacosanchez%2ecom
ICQ 101879542

Visit our electronics shop at http://www.opentronics.com

Check SIM+ at http://simplus.gsmeuropa.com
Up to 8 phone lines in a single GSM phone.