Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread Comma separated decimas in SQL
Mon, Jan 23 2006 8:20 AMPermanent Link

"Marcio Ehrlich"
This must be a recurrent question for comma separated decimal users: what is
the most practical way for formatting float values founded at a TEdit.text
(such as "1.234,567") to be used in a query?
Is there anything better than doing two StringReplace, one to take the
thousand separator off and other to replace the comma for a "."?
Thanks,
Marcio

Mon, Jan 23 2006 9:28 AMPermanent Link

"Ralf Mimoun"
Marcio Ehrlich wrote:
> This must be a recurrent question for comma separated decimal users:
> what is the most practical way for formatting float values founded at
> a TEdit.text (such as "1.234,567") to be used in a query?

That is a string, not a number. It just look this way for you. Use any
function that fits your needs to convert it in a float, and then use DBISAMs
AnsiStrToFloat. Everything else is a hack and will bite you back when
started on a machine with different setings.

Ralf

Mon, Jan 23 2006 5:41 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Ralf,

<< That is a string, not a number. It just look this way for you. Use any
function that fits your needs to convert it in a float, and then use DBISAMs
AnsiStrToFloat. >>

Just a note - the AnsiStrToFloat method is in the TDBISAMEngine component,
and you can just use the global dbisamtb.Engine instance to call it.

--
Tim Young
Elevate Software
www.elevatesoft.com

Image