Lucee 5.3.12.1 / 6.0 cfqueryparam cf_sql_decimal MSSQL weird behavior

I would like to report an unwanted behavior in Lucee tested from 5.3.12.1 up to 6.0:

I have a simple table in MSSQL:

CREATE TABLE [dbo].[valuetester](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[dec] [decimal](38, 20) NULL
) ON [PRIMARY]
GO

While inserting records in the table

    <cfquery datasource="testdb">
        INSERT INTO valuetester (
            [dec]
        )VALUES(
            <cfqueryparam cfsqltype="cf_sql_decimal"  scale="2" value="3.28">
        )
    </cfquery>

Produces this result:

lucee behavior

Why not 3.28000000000000000000 ?

Also switched between MSSQL drivers and versions

Same here with Lucee 6.0.0.585 and MSSQL, tried some other sqltypes too:

3.28000000000000000000|CHAR
3.27999999999999980000|NUMERIC
3.27999999999999980000|DECIMAL
3.27999999999999980000|DOUBLE
3.27999997138977050000|REAL
3.27999997138977050000|FLOAT

With CF2018 and MSSQL:

3.28000000000000000000|CHAR
3.28000000000000000000|NUMERIC
3.28000000000000000000|DECIMAL
3.27999999999999980000|DOUBLE
3.27999997138977050000|REAL
3.27999999999999980000|FLOAT

So in my tests Lucee numeric/decimal/double = CF double/float and Lucee real/float = CF real.

1 Like