Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/cformat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ function format( x::T;
( 1e-6, "μ" ),
( 1e-3, "m" ) ]
for (mag,sym) in smallscales
if abs(x) < mag*10
if abs(x) < mag*1000
x /= mag
suffix = string(sym, suffix)
break
Expand Down
2 changes: 2 additions & 0 deletions test/cformat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ end
@test format( 1.2e6, autoscale = :metric ) == "1.2M"
@test format( 1.2e3, autoscale = :metric ) == "1.2k"
@test format( 1.2e-6, autoscale = :metric ) == "1.2μ"
@test format( 1.2e-7, autoscale = :metric ) == "120n"
@test format( 1.2e-8, autoscale = :metric ) == "12n"
@test format( 1.2e-9, autoscale = :metric ) == "1.2n"
@test format( 1.2e-12, autoscale = :metric ) == "1.2p"

Expand Down
Loading