Page 1 of 1

StrF() and StrD() decimal places default change.

Posted: Mon Sep 20, 2010 3:26 am
by Rescator
Fred, any chance you could change the default for StrF() and StrD() to 7 and 15 decimal places respectively?
http://en.wikipedia.org/wiki/IEEE_float ... ic_formats
http://www.mathworks.com/help/techdoc/ref/format.html

The IEEE standards states that single float has 7.22 decimal precision and that double float has 15.95.
So therefore MATLAB rounds to 7 for singles and 15 for doubles. (If I recall correctly MySQL also does what MATLAB does.)
It kinda makes sense for the most common decimal places length to be the default.

Currently both StrF() and StrD() has a default of 10 decimal places.

Re: StrF() and StrD() decimal places default change.

Posted: Tue Sep 21, 2010 12:15 am
by Little John
Rescator wrote:Fred, any chance you could change the default for StrF() and StrD() to 7 and 15 decimal places respectively?
I agree.
It makes sense to return the maximum possible number of decimal places of the respective format by default -- but not more than the maximum possible number. :-)

Regards, Little John

Re: StrF() and StrD() decimal places default change.

Posted: Wed Sep 22, 2010 1:55 am
by kenmo
A good, sensible request.