Copy and paste numeric values from excel cell gets clipped

Tags: #<Tag:0x00007efc648af4a0>

Hi! I am new to using handsontable.

Could someone enlighten me on my problem.

I am using 8.2.

I copied a numeric value from excel file, let’s say 480,000. When i pasted it on handsontable, it displayed 480.

For the format, I used:

Var columns = [
{ type: ‘numeric’, format: ‘0,0’}
];

Thank you in advance.

Hi @egocentric13

Here’s a demo that can help https://jsfiddle.net/mnL37quz/

 {
        data: 'price_usd',
        type: 'numeric',
        numericFormat: {
          pattern: '$0,0.00',
          culture: 'en-US' // this is the default culture, set up for USD
        },
        allowEmpty: false

}

A comma in pattern is used to separate thousands and a dot is used to separate decimal places.

If you want to keep all the values in a format that 480,000 appears in the Handsontable as the same you need to define if those are 480 thousands or 480 with 3 decimal places (like here https://jsfiddle.net/mnL37quz/1/).

Hi! Thank you very much for your support!

I tried the second one you did in fiddle and it’s working just what I expected!

By the way, would this accept numbers in million? For instance 1,722,935. When I inputted it in the fiddle, the cell had red background color.

This format does not support two commas. You may need to write a custom validator to accept those values.

Ok, thank you for the suggestion and thank you again for your help!

1 Like