-
-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Labels
bugSomething isn't workingSomething isn't working
Milestone
Description
#import "@preview/oxifmt:0.3.0": strfmt
#strfmt("{:e}", decimal("0.31"))
wrongly shows as 1e-2
, presumably because it finds the "1" first here:
Lines 279 to 288 in c5a4066
let first-non-zero = fractional.position("1") | |
if first-non-zero == none { first-non-zero = fractional.position("2") } | |
if first-non-zero == none { first-non-zero = fractional.position("3") } | |
if first-non-zero == none { first-non-zero = fractional.position("4") } | |
if first-non-zero == none { first-non-zero = fractional.position("5") } | |
if first-non-zero == none { first-non-zero = fractional.position("6") } | |
if first-non-zero == none { first-non-zero = fractional.position("7") } | |
if first-non-zero == none { first-non-zero = fractional.position("8") } | |
if first-non-zero == none { first-non-zero = fractional.position("9") } | |
assert(first-non-zero != none, message: "String formatter internal error: expected non-zero fractional digit") |
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working