这是indexloc提供的服务,不要输入任何密码
Skip to content

v1.0.0

Latest
Compare
Choose a tag to compare
@PgBiel PgBiel released this 04 Jun 16:00
cd12791

oxifmt is two years old!

What's Changed

  • Breaking change: Replacement names can no longer contain braces for consistency with Rust. (Issue #17)
    • That is, {a {{ b} and {a }} b} are now errors.
    • Braces inside replacement names cannot be escaped, and } ends the name eagerly.
    • Leads to less apparent ambiguity in some cases, and is also what Rust does.
  • Breaking change: Private symbols are now hidden. This package's entrypoint now only exports the strfmt function. (PR #26)
    • Technically not a breaking change as these weren't intended for public usage, but worth giving some attention to anyway.
  • Added variably-sized thousands for insertion of separators through fmt-thousands-count: (group 1 size, group 2 size, ..., remaining group sizes). This may be useful for certain numbering systems used in India. (Issue #21)
    • For instance, one may have a digit group of size 3 followed by any amount of size 2 groups using strfmt("1000000", fmt-thousands-count: (3, 2), fmt-thousands-separator: ","), which outputs 10,00,000 (note that groups go from right to left, similarly to the numbers themselves).
  • Fixed an inconsistency with Rust where { and } would not be valid padding characters in format specifiers. The following is now valid: {:{<5} i.e. pad to 5 characters to the left with { (similarly for }). (Issue #28)
  • Fixed an inconsistency with Rust where center-aligned padding could result in more than the specified width as padding was forced to be equal on both sides for perfect centering. Now, strfmt("{:_^4}", "a") will output "_a__" (exactly 4 characters, even if not perfectly centered) instead of "__a__" (5 characters). (Issue #29)
  • Fixed a bug with scientific notation conversion for fixed-point decimal where certain digits would not be displayed. (Issue #23)

Full Changelog: v0.3.0...v1.0.0