Changin the "." to a "," for german pricegreenspun.com : LUSENET : S-Mart Shopping Cart : One Thread |
Hello everybody,I set up S.Mart and it works pretty good.
In Germany we use the "," instaed oft the "." for prices. Can you tell me how to change this.
I can change the Database but then the calculation is wrong.
Thanks for Help
Friedrich
-- Friedrich P. Gehindy (fgehindy@newlock.com), September 06, 1999
I am assuming that there is no way to get the server to recognize 48,90 as a number, and therefore your prices will have to remain in the database with decimal places (48.90) for calculation purposes. Others may know a way.But, you can do your calculations as decimals and display them the way you want. Do this every time you want to display a number:
#assign your number to a temporary variable in case you want to do #some more calculations with the original number $tempnum = $price;
#subsitute a "," for the "." $tempnum =~ s/./,/;
#now print $tempnum instead of $price
You could turn the substitution statement into a function so that you would not have to type it every time. Check out the Round and Pad functions in S-Mart.
It's a bit of work, but it's only in the sections that print out information.
Good luck.
-- Roy Lingen (rlingen@speedline.ca), September 17, 1999.
I do not know if this will work as I have never encountered it before. Yes the Germans do use a "," instead of a ".". I feel the prblem may be unix related similar to the very common requirement for using a "/" as in bill/@whatever.com. Maybe that will work. Just a thought, I might be very wrong. PorlGet your Christmas e-cards at http://www.namee.com.au/card
-- porl (info@namee.com.au), November 20, 1999.