Posted 23 September 2021, 5:55 am EST
Hi,
- I have a column with strings. Assume a string value as “123456” this is also getting formatted.
Setting the formatter of the column would be the recommended approach. Please refer to the following sample that demonstrates how you use the formatter on column level when using the setDataSource method.
sample: https://codesandbox.io/s/customformat-forked-oepgx?file=/src/index.js:754-756
- If so how can I handle -ve numbers as well?
You need to apply the formatter accordingly. Further, the provided above works well on negative numbers. Could you please explain exactly the issue that you facing?
- ``“##,##.##”` formatter not handling for large numbers
Could you please explain more about the issue and what number you are formatting using this format and is the result that you expecting?
- let’s say we have a cell value as 120 or a whole number, we should not get any decimal points.
Actually, the requirement is the combination of two formatter first formatter will apply ##,##.## to number if the number contains floating-point digit and the second formatter applied when the number is an integer that is, showing only the number, not decimal point.
For merging these formatter we need to create a custom formatter that is provided in above sample
Further, The custom format that we provided is working fine with this(120) number. please refer to the following sample.
sample: https://codesandbox.io/s/customformat-forked-xmxgz?file=/index.html
Regards,
Avinash