Greetings to Bergsoft comunity,
well, today i encountered another bug I think, well ok, am a bad liar. seen something similar a while ago in some other number components too, but did always work a way around it.
Been lazy and didn't roam around the sources, maybe later will.
I have set to all numeric columns its precision to 2, but on several rows, it does not round.
it happens when i set rows value with maths logic in it like for example from my code:
ng_preces.Cell[ng_preces_bp.Index, i].AsFloat := u_task.FieldByName('sm_p').AsFloat - u_task.FieldByName('sm_n').AsFloat - u_task.FieldByName('sm_i').AsFloat;
u_task is an sql returned dataset.
both storage types are Extended, and what's more weird is that values from dataset are already rounded to two digit precision, so i dont see a reason why 4186,23 - 3466,01 - 23,71 results in 696,509999999
so even if for some reason datasets field values precision floated for +- 0,000000001 as floats sometimes do, why cells display value isnt rounded according to set precision in TNxNumberColumn column properties?
usually i put maths logic in roundto(), but you know, with age am getting more and more lazy