Comments (7)
@abologna-r7 Thanks for pointing it out. I will fix this.
from react-number-format.
This would be useful for me as well!
from react-number-format.
@saidmoya12 @tsnolan23 What do you mean by display zero values ?
from react-number-format.
@s-yadav If the value
prop that is passed to the formatting component is equal to 0, it does not format the zero value.
For example, if I have this code:
<FormatNumber
value={this.props.test}
displayType={'text'}
thousandSeparator={true}
prefix={'$'} />
If this.props.test
is equal to say 30000, the result would be $30,000, which is the intended functionality, however if this.props.test
is equal to zero, it does NOT return $0, it returns nothing at all.
from react-number-format.
Problem is with line 127 since the following statement will be executed when value is 0:
if(!val || !((val+'').match(numRegex))) return {value :'', formattedValue: (maskPattern ? '' : '')}
from react-number-format.
Thanks ;)
from react-number-format.
Is this fixed?
from react-number-format.
Related Issues (20)
- I only want to see number only? HOT 3
- Add link to your documentation to repository details HOT 2
- `suffix` not working properly in `jest` + `testing-library` HOT 2
- onValueChange not always fire HOT 1
- Is that any way possible to just display the number as user enters and do not apply formatting. Currently I am facing the issue on when I type more than 16 digits it automatically get formatted and inserted 0 at last when i type further.
- 5.3.1 Regression: Typing "." leads to "^0.00" where "^" is location of caret HOT 1
- NumericFormat: customInput Antd Input is not working properly HOT 9
- Rounding with decimalScale={1} HOT 1
- IPv4 Address Mask HOT 1
- NumericFormat suffix is not allowing antdesign input to handle suffix HOT 1
- Support IME japanese keyboard HOT 2
- Not able to delete negative sign using backspace button HOT 1
- Intl.NumberFormat with fraction digits. input box <=> form state mismatch HOT 2
- percentage formatting, input box <=> form state mismatch
- Controlled Input will convert -0 to 0 HOT 2
- Problem with default value doesnt override mask, but add this value to end mask HOT 1
- Package should not throw errors when `thousandSeparator` and `decimalSeparator` are similar
- Caret moved at the end when used with Ant Design library HOT 2
- The caret position isn't set properly when I use the `removeFormatting` function to use the Persian numbers with the `thousandSeparator` prop HOT 3
- Removing last number with trailing zeros deletes all the right side zeros, when integrating with `react-hook-form` HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-number-format.