Hi..
Its irking me, as I have not found a simple solution. I am writing an application that requires banker's rounding, so the round function is useless..
basicaly i need to be able to round to either 2 or 4 decimal places using bankers rounding..
eg
double a = 107.10;
double b = bankersrounding(a / 12.0,2);
b should equal 8.93, not 8.925 or 9 or 8..
also a value of 8.935 rounded to 2dp should be 8.94
Any ideas on a simple function or of QT actually implements this - or some form of decimal currency type that handles this automatically?
Ta.
Mathew.
Bookmarks