> If I add these numbers, the outcome should be 17744.06. Any ideas? I am > using Digital Mars D Compiler v1.046. > josé
This prints the same values, using latest D2: import std.stdio, std.conv; void main() { real tot = 0; foreach(el; ["14539.34","1230.00","361.62","1613.10","0.00"]) tot += to!real(el); writefln("%.5f\n", tot); // 17744.06000 tot = 0; foreach(el; [14539.34,1230.00,361.62,1613.10,0.00]) tot += to!real(el); writefln("%.5f\n", tot); // 17744.06000 } Bye, bearophile