Hello
writeln(Round(9.005;2)) // 9.01 ok writeln(Round(9.015;2)) // 9.02 ok writeln(Round(9.025;2)) // 9.03 ok writeln(Round(9.035;2)) // 9.04 ok writeln(Round(9.045;2)) // 9.05 ok writeln(Round(9.055;2)) // 9.06 ok writeln(Round(9.065;2)) // 9.07 ok writeln(Round(9.075;2)) // 9.07 not ok writeln(Round(9.085;2)) // 9.09 ok writeln(Round(9.095;2)) // 9.1 ok writeln(Round(9.105;2)) // 9.11 ok writeln(Round(9.115;2)) // 9.12 ok writeln(Round(9.125;2)) // 9.13 ok writeln(Round(9.135;2)) // 9.14 ok writeln(Round(9.145;2)) // 9.15 ok writeln(Round(9.155;2)) // 9.15 not ok writeln(Round(9.165;2)) // 9.16 not ok writeln(Round(9.175;2)) // 9.18 ok writeln(Round(9.185;2)) // 9.19 ok writeln(Round(9.195;2)) // 9.2 ok Active4D 6.0r8. OS X 10.7.5 with 4D v13.2 (122395) Regards, Oliver Am 31.01.2013 um 17:34 schrieb Donahue, Clayton: > Hi Mike, > > Yes - I am getting the same result as you: 9.07 > > 4D Server 13.2 > Windows 7, 64 bit > Active4D 6.0.6 > > - Clayton > > > On Thu, Jan 31, 2013 at 11:23 AM, Mike Vogt <[email protected]>wrote: > >> Hi All, >> Can anyone else reproduce this? >> >> I'm getting incorrect results when doing the following in an Active4D >> script: >> >> $cost:=50 >> $rate:=18.15 >> $fee:= $cost*$rate/100 >> $fee_rounded:=Round($fee;2) >> >> When I do this and display it in an page, $fee is 9.075, and $fee_rounded >> is 9.07. >> >> If I create a function in 4D: >> >> //Function test_round: >> >> C_real($0;$1) >> $0:=Round($1;2) >> >> //End function >> >> If I then replace the last line of code above to: >> $ fee_rounded:=test_round($fee) >> >> and display it in an page, $fee is 9.075, and $fee_rounded is 9.08. >> >> In other words, Round, when called directly in an Active4D script produces >> incorrect results (9.07), but when call from a 4D function works >> correctly(9.08). >> >> 4D Server 12.4 >> Windows 2008 server, 64 bit >> Active4D v6.0 r6 >> >> Any help appreciated. >> >> TIA, >> MV >> >> _______________________________________________ >> Active4D-dev mailing list >> [email protected] >> http://list.aparajitaworld.com/listinfo/active4d-dev >> Archives: http://active4d-nabble.aparajitaworld.com/ >> > > > > -- > > *Clayton Donahue* > > iVantage Health Analytics > 300 Chestnut St. Ste. 101 | Needham, MA 02492 > direct: 781.247.2071 | o: 781.449.5287 | f: 781.449.8058 > email: [email protected] web: www.ivantagehealth.com > > ___________________________________________________ > > Intelligence for the *new* healthcare > _______________________________________________ > Active4D-dev mailing list > [email protected] > http://list.aparajitaworld.com/listinfo/active4d-dev > Archives: http://active4d-nabble.aparajitaworld.com/ _______________________________________________ Active4D-dev mailing list [email protected] http://list.aparajitaworld.com/listinfo/active4d-dev Archives: http://active4d-nabble.aparajitaworld.com/
