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 various commands. 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 values and 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 and comma for decimal values (1.000,00). One solution would be to tell the clients (which are uploading via ftp) to change the number format in their database, but they _will_ forget to do so, 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 during calculation 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 Ostry Vienna/Austria po@ostry.com www.ostry.com Associated Messages, from the most recent to the oldest:

    
  1. Re: math and european notation (Grant Hulbert 1998)
  2. math and european notation (Peter Ostry 1998)
I am new to WebCat so I might not fully understand the syntax of various commands. 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 values and 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 and comma for decimal values (1.000,00). One solution would be to tell the clients (which are uploading via ftp) to change the number format in their database, but they _will_ forget to do so, 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 during calculation 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 Ostry Vienna/Austria po@ostry.com www.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:

TeaRoom Order fields email account remain empty even though thewy are filled. (1997) Shipping charges based on dollar level (1997) problems with WebCat-Plugin (1997) [WebDNA] [OT] economical reliable SSL certs? (2009) RAW=T..Strange behaviour (2000) [WebDNA] Dynamic vertical columns (2008) WebDNA implementation of MD5 algorithm? (2003) [feature req?]DeleteFounditem (2002) Include Troubles (1998) PSC recommends what date format yr 2000??? (1997) Generating Report Totals (1997) firewall ports for Mac OS X/WebCatalog (2001) MacWEEK article help needed (1996) ConverChars (1999) syntax question, not in online refernce (1997) Outlook Rule (2002) email messages (1997) E-mail Attachments (1997) Snake Bites (1997) RE: [WebDNA] lists opinion (2009)