Link to home
Start Free TrialLog in
Avatar of Witheet
WitheetFlag for Netherlands

asked on

Curency formatting issue using dots and commas

Hello all,

I have a mysql database with simple cms to insert update records. 1 of the fields you can update is the price of an article. The field is set to decimal(length 19 and decimals 2) in the database and I insert and update this field as numeric value in cms...

I apparently need the notation of the currency to be 24.95 in my cms to insert the data correctly in to database. If I use: 24,95 it only registers 24
However when displayed on the site or in the database itselve and the cms update page to, the entered value gets displayed like: 24,95 instead of the entered 24.95

A. I do not get why it does this
B. What besides a replacestring in the price field value on the update page of the cms to ensure it gets updated correctly (with . instead of ,) can i do to get the price displaid like I want and that is with .(dot) on the site...

I dont get it... Hope someone can help me understand this.
What confuses me is that I have to enter it like 24.95 to make sure it gets written in to database like 24,95

WKR
Witheet
Avatar of Witheet
Witheet
Flag of Netherlands image

ASKER

to answer a part of my own question...

<%=cStr(Replace((Titel.Fields.Item("T_Prijs").Value), ",", "."))%>

can be used to format the price on the site and in field update pagine in cms.
I still would like to understand why it needs the . to enter data correctly... (Only to prevent the instert statement not to crash?)

And now I am stuck with this: Prices like 24.90 get displayed like: like 24.9
Because I lost the: <%= FormatNumber((Titel.Fields.Item("T_Prijs").Value), 2, -2, -2, -2) %>
when i replaced it with: <%=cStr(Replace((Titel.Fields.Item("T_Prijs").Value), ",", "."))%>
Is there a qya to combine these 2? So it replaces the , and also shows the 0?

Witheet
ASKER CERTIFIED SOLUTION
Avatar of Witheet
Witheet
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial