Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decimal Interpolation #7

Open
batiati opened this issue Aug 4, 2022 · 0 comments
Open

Decimal Interpolation #7

batiati opened this issue Aug 4, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@batiati
Copy link
Owner

batiati commented Aug 4, 2022

We fail with this test from mustaches spec

- name: Basic Decimal Interpolation
    desc: Decimals should interpolate seamlessly with proper significance.
    data: { power: 1.210 }
    template: '"{{power}} jiggawatts!"'
    expected: '"1.21 jiggawatts!"'

Suggestions:

  • Implement a custom formatter for floats
  • Introduce a new configuration for max float precision, preventing from rendering things like 1.21000345698
  • Maybe waiting for Ryu floating point printing
@batiati batiati added the bug Something isn't working label Aug 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant