Skip to main content
Inspiring
April 17, 2012
Answered

real number returned with comma as decimal delimiter

  • April 17, 2012
  • 1 reply
  • 2141 views

Hi,
I have CF9 installed on W7 using an Access database.
In a table I have a currency value of
-488.7

The windows is French, but I have set the delimiter for both the decimal values AND currency values to dot instead of comma.

Though I get this error in CF:

The value -488,7 cannot be converted to a number.

CF is receiving the value with a comma instead of a dot.

- If I browse the table under Access, the value is correctly displayed with a dot.

- If I modify the column type to teTEXT instead of real or currency, the value is converted to text with a dot, and there is no error in CF.

Obviously a conversion from dot to comma is made in some other layer, but where?

I've checked in the ODBC connection and found nothing.

Any idea?

This topic has been closed for replies.
Correct answer Claude1

>>If you do a simple query and cfdump the result, do you get a period or comma?

Yes I do.

But I finaly found the problem.

The query is produced by a UNION, and in one of the sub SELECTs, the column was set to '0' instead of 0. This tiggered a converstion to text for the same column in the next SELECT, probably in the ODBC driver, and this conversion implied the use of a comma instead of a dot. For some unknown reason, it follows the rule for French because the version of Windows is French, but bypasses the settings in Windows.

1 reply

Inspiring
April 18, 2012

If you do a simple query and cfdump the result, do you get a period or comma?

Claude1AuthorCorrect answer
Inspiring
April 18, 2012

>>If you do a simple query and cfdump the result, do you get a period or comma?

Yes I do.

But I finaly found the problem.

The query is produced by a UNION, and in one of the sub SELECTs, the column was set to '0' instead of 0. This tiggered a converstion to text for the same column in the next SELECT, probably in the ODBC driver, and this conversion implied the use of a comma instead of a dot. For some unknown reason, it follows the rule for French because the version of Windows is French, but bypasses the settings in Windows.

Inspiring
April 18, 2012

You mean you had a query like this:

select some_text_field, etc

union

select some_numeric_field, etc

that didn't error out?

I just tried that in redbrick and sql server and in both cases, they crashed.