`strfmt("{:.0}", -0.1)` should omit negative sign
Closed this issue · 3 comments
ntjess commented
#strfmt("{:.0}", -0.1)
displays as -0
, where 0
would be more appropriate
PgBiel commented
This is expected behavior, as it's how Rust does it, and this package aims to be as close as possible to Rust's format!
function. You could use something such as
#let old-strfmt = strfmt
#let strfmt(..args) = {
let result = old-strfmt(..args)
if result == "-0" { "0" } else { result }
}
We could consider adding some sort of custom flag which just does that, but I'm not sure if it's worth it...
So I'll be closing the issue for now, but thanks for bringing this up.
ntjess commented