James[UH]
12-10-2002, 10:16 PM
m00,
OK, got a db, with the number 16.50 in it, but the output on the page only displays 16 not the decimal.
Using the code:
£<%=rs("ProductPrice")%>
To display the number. It works, but doesnt display tfhe decimal place numbers. Such as the .50
Anyone know a way round this?
rlynch
12-10-2002, 11:03 PM
i have teh same problem in javascript
James[UH]
12-10-2002, 11:04 PM
:/
I dont want to lower/higher my prices by 50p on every thing that costs £x.50 :P
aleborg
12-11-2002, 11:03 AM
This is a bub in MyODBC, use a DSN connection and it will work!
PJamie
12-11-2002, 11:20 AM
or use
<%=formatcurrency(rs("ProductPrice"),2)%> which will automatically insert the default currency symbol, or
£<%=formatnumber(rs("ProductPrice"),2)%>
The number after the comma being the number of decimal places you want to display.
sylow
12-11-2002, 11:26 AM
Prefer ADO connection directly to DB(access or SQL Server you have?)
I do not recommend anybody ODBC if you do not have to use.
MHO
James[UH]
12-11-2002, 11:51 AM
I converted the code over to a DSN connection, setup a DSN and its working :)
Cheers guys.
aleborg
12-11-2002, 12:24 PM
Originally posted by PJamie
or use
<%=formatcurrency(rs("ProductPrice"),2)%> which will automatically insert the default currency symbol, or
£<%=formatnumber(rs("ProductPrice"),2)%>
The number after the comma being the number of decimal places you want to display.
So do I, but If you're using MySQL you MUST use a DSN to get the decimals to work. If you're using local settings, "Don't use setlocale" should be checked.
formatcurrency and formatnumber won't work!
PJamie
12-11-2002, 07:24 PM
Formatcurrency might not work if it can't find the locale, but formatnumber will always work although it might not produce the correct number if you can't get the decimal point back in the first place!
I don't use MySQL so I've never come across the decimal not being returned from a DB before. Seems a bit odd, but useful to know if I ever do get round to using it myself. Apologies to all.