hi everyone,
it may be that i am a little blind today
i want to round numbers, but very small ones,
for example 6.23455E-27 which has 32 decimal places to 6.235E-27 which has 30 decimal places,
‘round’ fails with error messages (Err:502 on screen, IllegalArgumentException in macro) as soon as i enter as second argument a greater number than 20,
this makes sense for numbers in decimal notation as calc is limited to 20 decimals on screen, but not for ‘scientific’,
what do i need the nonsense for? i want to try an automatic rounding to avoid fp-errors, and this can happen as a side effect,
i know that i could write my own rounding routine, but it would be nice if i could do it somehow ‘with onboard tools’,
it’s not! about getting that to work on the screen / in the UI (user interface) but to be able to use it in a macro,
as the basic language for macros seems to not to have a rounding function i made that from uno? available with:
function round_a (ByVal darg1 as Double, iarg2 as Integer)
'make round functionality accessible from basic macros,
oFunctionAccess = createUnoService( "com.sun.star.sheet.FunctionAccess")
round_a = oFunctionAccess.callFunction( "ROUND", array(darg1, iarg2))
end function
but that fails for arguments above 20 as well as ‘onscreen use’ of ‘=round(6.23455E-27; 21)’,
anybody an idea?