math and european notation
This WebDNA talk-list message is from 1998
It keeps the original formatting.
numero = 16168
interpreted = N
texte = I am new to WebCat so I might not fully understand the syntax of variouscommands. One problem now:I show a shopping cart in a table and want to multiply quantity with price.[math][itemprice]*[quantity][/math] gives a wrong result with some valuesand I did some tests:[itemprice] is 80,00 and[math][itemprice]*1[/math] displays 80 which is right.but:[itemprice] is 17,90 and[math][itemprice]*1[/math] displays 9 --> huh?The [math] tag simply shows only values after the comma if they are not zero.I believe this is a problem with europaean notation - dot for thousands andcomma for decimal values (1.000,00).One solution would be to tell the clients (which are uploading via ftp) tochange the number format in their database, but they _will_ forget to doso, you know...I found a workaround using nested format:[format ,2f][math][format f][itemprice][/format]*[quantity][/math][/format]That works and seems to do some reformatting on the price field duringcalculation even with european format in the database. Does [format f]eliminate all punctuations and treats the numbers only?Or is there a better solution?Peter______________Peter OstryVienna/Austriapo@ostry.comwww.ostry.com
Associated Messages, from the most recent to the oldest:
I am new to WebCat so I might not fully understand the syntax of variouscommands. One problem now:I show a shopping cart in a table and want to multiply quantity with price.
[math][itemprice]*[quantity][/math] gives a wrong result with some valuesand I did some tests:[itemprice] is 80,00 and
[math][itemprice]*1[/math] displays 80 which is right.but:[itemprice] is 17,90 and
[math][itemprice]*1[/math] displays 9 --> huh?The
[math] tag simply shows only values after the comma if they are not zero.I believe this is a problem with europaean notation - dot for thousands andcomma for decimal values (1.000,00).One solution would be to tell the clients (which are uploading via ftp) tochange the number format in their database, but they _will_ forget to doso, you know...I found a workaround using nested format:[format ,2f]
[math][format f][itemprice][/format]*[quantity][/math][/format]That works and seems to do some reformatting on the price field duringcalculation even with european format in the database. Does [format f]eliminate all punctuations and treats the numbers only?Or is there a better solution?Peter______________Peter OstryVienna/Austriapo@ostry.comwww.ostry.com
Peter Ostry
DOWNLOAD WEBDNA NOW!
Top Articles:
Talk List
The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...
Related Readings:
Mime Headers for Mail (1998)
Calculating multiple shipping... (1997)
Email (2000)
this year (2000)
slow site (2003)
No comment (1997)
[format xs] freeze (1997)
[WebDNA] Installing 6.0 onto Server 2008 (2011)
Why are some admin pages not encrypted? (2000)
[WebDNA] SSL not working with WebDNA FCGI 8.5.1 (2020)
Error -108 (1997)
Re:quit command on NT (1997)
WebCat2b12 CGI Mac - [shownext] problem (1997)
UPS Shipping (1999)
Enterprise Server (1998)
Summing fields (1997)
Logging purchases (1997)
WebCat2b14MacPlugIn - [include] doesn't hide the search string (1997)
encrypted database (2004)
Grep and removing text (2002)