Numeric Format

Tags: #<Tag:0x00007efc6d5993e8>

I have a data looks like 1,000,000.00 can i convert it to 1000000.00 and how to do it with numericFormat?

Hi @khoironidev

Yes, you can do it by changing the numericFormat pattern, here’s an example:
https://jsfiddle.net/aszymanski/o5Lc3agv/

I am using
type: ‘numeric’,
correctFormat: true,
numericFormat: {
pattern: ‘0.00’,
}

but its not correcting automatically
image
the final result i want is from 10,000,000.00 to 10000000.00.
Is it because the data is string?

Hi @khoironidev

Yes, you are correct. The data isn’t converted automatically because it’s a string. You can use beforeChange hook and try to eliminate the commas using https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace method.

I hope that helps.