Skip to content

Commit

Permalink
fix inf string in 0.12.0
Browse files Browse the repository at this point in the history
  • Loading branch information
PgBiel committed Oct 9, 2024
1 parent c9d950e commit 2a4094f
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions oxifmt.typ
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,16 @@
}

#let _strfmt_stringify(obj) = {
if type(obj) in (_int-type, _float-type) {
// Fix negative sign not being a hyphen
// for consistency with our rich formatting output
if type(obj) == _float-type {
if _float-is-infinite(obj) {
// Fix 0.12.0 inf string inconsistency
if obj < 0 { "-" } else { "" } + "inf"
} else {
// Fix negative sign not being a hyphen
// for consistency with our rich formatting output
str(obj).replace("\u{2212}", "-")
}
} else if type(obj) == _int-type {
str(obj).replace("\u{2212}", "-")
} else if type(obj) in (_label-type, _str-type) {
str(obj)
Expand Down

0 comments on commit 2a4094f

Please sign in to comment.