question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error with float number

See original GitHub issue

My mask setting is as follows. prefix="R$ "

mask="separator.2"
thousandSeparator="."
decimalMarker=","

When I load a float value equal to 2896.99 -expected value = 2.896,99 -but the displayed value = 289.699

what would be the solution for my case?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:12 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
ColinMorris83commented, Nov 5, 2019

You can specify decimalMarker. e.g.

mask="separator.2"
thousandSeparator=","
decimalMarker="."

If you now paste in 2896.99, it will display in the input as 2,896.99 and it’s actual model value will remain as 2896.99

0reactions
lucasglobalsyscommented, Jun 19, 2020

Same issue

Read more comments on GitHub >

github_iconTop Results From Across the Web

Floating-point error mitigation - Wikipedia
Floating-point error mitigation is the minimization of errors caused by the fact that real numbers cannot, in general, be accurately represented in a...
Read more >
Floating point error in Python - GeeksforGeeks
It's a problem caused when the internal representation of floating-point numbers, which uses a fixed number of binary digits to represent a ...
Read more >
What Every Computer Scientist Should Know About Floating ...
Another way to measure the difference between a floating-point number and the real number it is approximating is relative error, which is simply...
Read more >
Floating point error - Matthew Brett on github
The IEEE standard for floating point specifies that the result of any floating point operation should be correct to within the rounding error...
Read more >
15. Floating Point Arithmetic: Issues and Limitations — Python ...
Unfortunately, most decimal fractions cannot be represented exactly as binary fractions. A consequence is that, in general, the decimal floating-point numbers ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found