by xProgrammer » Thu Feb 18, 2010 3:02 am
Hi all
I suspect there is a fundamental point to be made here. That when stored as a numeric value in [x]Harbour etc 495.0, 495.00, 495.0000 and Round( 495.0000, 2 ) are all stored identically.
Round( , 2) would change the internally stored value of 495.006 to 495.01 (and be the same as 495.01, 495.0100 etc).
You have to distinguish between the internal storage of the number (which doesn't recognise the number of significant digits) and its output through functions such as MsgInfo(), Str(), Transform etc. which in some cases will do their own rounding.
I also note, from the xHarbour documentation, that in the absence of a SET DECIMALS command the default should be 2, although SET DECIMALS without a value specified sets it to 0. It also notes that you need SET FIXED ON. These two settings affects on screen display - ? and QOut() and the standard say / get system. It has no bearing on the precision of numbers (other than certain advanced mathematical functions).
I haven't looked at the MsgInfo() code, but you can retrieve the value of SET DECIMALS and SET EXACT using the Set() function so it wouldn't be hard to make MsgInfo() SET DECIMALS and SET EXACT aware if you so wished. Remember MsgInfo() is a FWH extension (and a very useful one too) but is not a standard [x]Harbour screen display function.
Regards
xProgrammer