# number formatting

Is it possible to display all numbers >= 10^4 (or <= 10^-4) in scientific notation?

Regards

Georg

number formatting

Is it possible to display all numbers >= 10^4 (or <= 10^-4) in scientific notation?

Regards

Georg

add a comment

0

You could use python's string formatting to print numbers in scientific notation:

```
sage: n = 215.685
sage: print "my number is %e"%n
my number is 2.156850e+02
sage: print "my number is %E"%n
my number is 2.156850E+02
```

Is that the kind of thing you're looking for?

No. I want something like that: sage: x=1.2345678 -> sage: x -> 1.2345678 sage: x = 0.00003 -> sage: x -> 3E-05. Sage print a number x in scientific notation if x>=10^7 or 0 < x <= 10^-7.

Maybe the ticket http://trac.sagemath.org/sage_trac/ticket/7682 would resolve the issue?

Asked: **
2011-09-04 01:11:09 -0500
**

Seen: **2,427 times**

Last updated: **Sep 04 '11**

How can I find the sum of fibonacci (1) + (2) + (4) + (7) + (11) + (16) + ... ?

list of graphs whowe independence number <= 2 [closed]

Converting string into number does not work properly

factorization on number fields

How to check if a square root is irrational

Why is 3e1 not equivalent to 30?

Counting number of trues in a 1000 line answer

solve() is not giving the right solutions

What are the differences between RealDoubleField() and RealField(53) ?

Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.