LO Calc: macro print scientific notation if first decimal place is 0

Hi everyone!

I’ve noticed a strange behaviour: in LO Calc if i print the value of a cell, it returns me scientific notation if the value has “0” is in the first decimal place.
For example, if the value is 0.1126, the function correctly shows me “0.1126” but if the value is 0.0126 it shows me “1.26E-02”.
the function is very easy:

function printVariable(float_number as double) as double
print "Number: " + float_number
end function
i’ve tried also to set float_number as single but it still not working and i’ve tried with different version of LO.
the cell is formatted as Number with 4 decimal places and 1 leading zeroes.

why and i can correct this?

thanks!

Use Format function.

it works!!
thanks a lot!!!