This topic is locked

Store numeric data in mysql db

8/31/2009 5:59:21 AM
ASPRunnerPro General questions
Z
zion4ever author

Hi all,
Maybe a silly question, but can't seem to find the solution.

I have a mysql database field named "Price". This field holds the prices for products being offered. This field has datatype decimal. Now, when I enter, let's say "43,50" in the asprunner output text field, the saved result is "44"
I have tried different datatypes for the field, but the only one that works is varchar. However, I want to be able to do queries on WHERE Price > some amount.
Is this a mysql issue or does asprunner use a round function somewhere?

Should I store prices as varchar and do my own parsing (clng) in the event editor?
One last question, can you advise on how to deal with international website vistors? Some might use a comma as a decimal delimiter, others a dot. I just want it to be recognized as a money value and be saved as a searcheable field.
Your answer is greatly appreciated.
Hans

Z
zion4ever author 9/1/2009

Surely someone must have the answer to this question. Please, I really need to know. Thanks in advance.

Sergey Kornilov admin 9/1/2009

It all depends on how you display the price field. It's quite possible price is stored properly as 43.50 but displayed as 44.
I recommend to post your application to Demo Account (use 'Demo Account' button on the last screen in program). Then open a ticket at http://support.xlinesoft.com sending your Demo Account URL for investigation.
In regards to international visitors - you can display prices according to selected language (regional setting) however editing must be done using either dot or comma as a delimiter not both.

M
Maurits 9/2/2009



It all depends on how you display the price field. It's quite possible price is stored properly as 43.50 but displayed as 44.
I recommend to post your application to Demo Account (use 'Demo Account' button on the last screen in program). Then open a ticket at http://support.xlinesoft.com sending your Demo Account URL for investigation.
In regards to international visitors - you can display prices according to selected language (regional setting) however editing must be done using either dot or comma as a delimiter not both.


I have had the same problem, everything rounded up or down to a whole number. No matter what settings i used in ASPRunner.

I had a look at the Access Database table. If you add a field that has to be a number it automatically adds "integer". I had to set it to "Sinlge/Double" to get it stored right in the database. So as integer 43.50 will be 44 as it rounds to the nearest.
Maybe this can be of help

http://msdn.microsoft.com/en-us/library/47zceaw7.aspx