Rounding(Float)

<< Click to Display Table of Contents >>

Navigation:  SQL > SQL - solving issues >

Rounding(Float)

Previous pageReturn to chapter overviewNext page

Rounding float values with BDE Local SQL

One of the missings of BDE LocalSQL is Rounding of floating point values.
However, this may be solved using e.g.:

SELECT 

  b."Species No"

, Category

, Common_Name

, b."Species Name"

, b."Length (cm)"

, CAST(CAST(((Length_In) * 10 + 0.5) AS INTEGER) AS FLOAT) / 10 AS b."Length (In)"

, Notes

, Graphic

FROM biolife b

;

rounding e.g. Length_In = 19.6850393700787 to 19.7
where the using 10 as the multiplier/divisor in the CAST function will round to one decimal, and using 100 yielding two decimals, etc.

See also the Local SQL manual (via the Help menu).

__________________________
PdxEditor Application Help, 14 July 2026; © 2010-2026 Niels Knabe