123
Views
4
Comments
Solved
MySQL - Float: Hidden Round Down
Question

Hi there,

just to inform, i have a table and a column of type float, when i run IFNULL construct in a sql widget - this is not because of the widget, but the mysql itself:

SyntaxEditor Code Snippet

IFNULL(mycolfloat,-999999999) mycolfloat

the result is -1000000000 if it is NULL, also happen to -999999998, -999999 ...round down...

and to work around, just add decimal:

SyntaxEditor Code Snippet

IFNULL(mycolfloat,-999999999.0) mycolfloat

regards

2018-10-29 08-31-03
João Marques
 
MVP
Solution

Hi Boring,


To complement your example, the rounding method / behavior can vary using the native OutSystems Round action or the ones in SQL can also vary depending on whether you are using SQL Server / Oracle / DB2 / MySQL.

OutSystems documentation provides here the detailed explanation and some examples with differences on using OutSystems native Round method and database server methods.

2012-03-16 12-21-09
João Rosado
Staff

Hi Boring,


What platform version/revision is that in?

I remember some years ago to see a fix for something like that for mssql. (Also pretty sure the fix was not database specific)


Regards,

João Rosado

2012-03-16 12-21-09
João Rosado
Staff

Think it was this one:

https://www.outsystems.com/home/downloadsdetail/76/1882/downloadsdetail

  • Fixed precision of very large decimal literals (#1322328)

That particular fix was rolled out in 8.0.1.75, 9.0.1.75 and 9.1.600.0


Not sure if it's the same problem, but don't have a mysql database at hand to try it.

2020-06-08 02-42-28
Wasabi

Thank you Sirs.

It has nothing to do with the platform, even if i select in an MYSQL editor like HEidiSQL, the result is rounded.

regards

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.