I don't see any issues with your approach. Where are you seeing or entering that many decimal places? What are you system settings for number of decimal places by currency?
Not sure if the problem has to do with you owing one amount with many decimals and paying another not quite exact amount or with this issue outlined at the link below on float precision:
http://weberp-accounting.1478800.n4.nabb...l#a4657962
Either way the dashboard already is doing some editing (like looking for > .004 instead of > 0) in some queries and also not displaying unless the locale format <> 0. So you are just doing the same thing in a different way.
However, if you plan on using more that 2 decimal places for some currencies you may wish consider another method.
Example (From A/R header section, shoudl be copied down to detail display section):
$DisplayDue = locale_number_format($AgedAnalysis['due']-$AgedAnalysis['overdue1'],$CurrDecimalPlaces);
$DisplayCurrent = locale_number_format($AgedAnalysis['balance']-$AgedAnalysis['due'],$CurrDecimalPlaces);
$DisplayBalance = locale_number_format($AgedAnalysis['balance'],$CurrDecimalPlaces);
$DisplayOverdue1 = locale_number_format($AgedAnalysis['overdue1']-$AgedAnalysis['overdue2'],$CurrDecimalPlaces);
$DisplayOverdue2 = locale_number_format($AgedAnalysis['overdue2'],$CurrDecimalPlaces);
if ($DisplayDue <> 0 OR $DisplayOverdue1 <> 0 OR $DisplayOverdue2 <> 0)