This is a discussion on how to display numbers with exponent within the MySQL General forum forums, part of the MySQL category; --> Hello again, I inserted "double" values, like : mysql> insert into t (n) values ('0.54316E+11'); then I display it ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hello again, I inserted "double" values, like : mysql> insert into t (n) values ('0.54316E+11'); then I display it as : 54316000000 which is not easy to read. Is there a way to tell Mysql to display such numbers with exponent ? I could not find a trick through and around http://dev.mysql.com/doc/refman/5.0/...h-numbers.html thanks. _-¯-_-¯-_-¯-_-¯-_ Gilles Missonnier IAP - gimi@iap.fr 01 44 32 81 36 |
| ||||
| > I inserted "double" values, like : > mysql> insert into t (n) values ('0.54316E+11'); > > then I display it as : > 54316000000 > which is not easy to read. SELECT FORMAT(54316000000,0) gives: 54,316,000,000 > Is there a way to tell Mysql to display such numbers > with exponent ? I have not found any, but a way around, if you use c, php, ... is to format result from db, like: printf('%e',54316000000) -> 5.431600e+10 printf('%.3e',54316000000) -> 5.432e+10 http://fr.php.net/printf Also found this: Navicat, Display formats, Numeric fields, Specifier E+: http://www.navicat.com/win_manual/OptionFormat.html regards arnulf @ http://s-a.no/ > I could not find a trick through and around > http://dev.mysql.com/doc/refman/5.0/...h-numbers.html > > thanks. > > _-¯-_-¯-_-¯-_-¯-_ > Gilles Missonnier > IAP - gimi@iap.fr > 01 44 32 81 36 |