Adding a thousand separator
Adding a thousand separator
Norman,
How easy would it be to amend NorPrice to format the output with a thousands separator on currencies such as Japanese Yen?
Finance Director does not like the current display.
thanks,
Bill
How easy would it be to amend NorPrice to format the output with a thousands separator on currencies such as Japanese Yen?
Finance Director does not like the current display.
thanks,
Bill
NorPrice displays the alternate currency in 2 ways. If the exchange rate is below a certain value (CUSTOMVAR:HIDEFRACTIONRATE) it uses nnnn.nn If the exchange rate is above it just displays the integer value.
Neither of these routines do any comma type formatting. It wouldn't be hard to add, however. All you'd need to do is alter 2 files
Cart and Checkout the Perl routine ActinicOrder.pm, lines the format strings within
$sFormattedPrice .= sprintf(" (%d $iso)", $nNorprice);
and
$sFormattedPrice .= sprintf(" (%1.2f $iso)", $nNorprice);
for the integer and decimal version.
For the Product page, norpricesupport.js JavaScript and the lines are
return prefix + ' (' + optplus + Math.round(altprice) + ' ' + isoname + ')' + suffix;
and
return prefix + ' (' + optplus + topounds(altprice) + ' ' + isoname + ')' + suffix;
where the Math.round(altprice) and topounds(altprice) would need some code added to fit in the commas.
This http://www.web-source.net/web_developme ... atting.htm page contains some routines for both Perl and JavaScript.
Neither of these routines do any comma type formatting. It wouldn't be hard to add, however. All you'd need to do is alter 2 files
Cart and Checkout the Perl routine ActinicOrder.pm, lines the format strings within
$sFormattedPrice .= sprintf(" (%d $iso)", $nNorprice);
and
$sFormattedPrice .= sprintf(" (%1.2f $iso)", $nNorprice);
for the integer and decimal version.
For the Product page, norpricesupport.js JavaScript and the lines are
return prefix + ' (' + optplus + Math.round(altprice) + ' ' + isoname + ')' + suffix;
and
return prefix + ' (' + optplus + topounds(altprice) + ' ' + isoname + ')' + suffix;
where the Math.round(altprice) and topounds(altprice) would need some code added to fit in the commas.
This http://www.web-source.net/web_developme ... atting.htm page contains some routines for both Perl and JavaScript.
Norman