Changin the "." to a "," for german pricegreenspun.com : LUSENET : S-Mart Shopping Cart : One Thread
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 P. Gehindy (firstname.lastname@example.org), 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.
-- Roy Lingen (email@example.com), 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 firstname.lastname@example.org. Maybe that will work. Just a thought, I might be very wrong. Porl
Get your Christmas e-cards at http://www.namee.com.au/card
-- porl (email@example.com), November 20, 1999.