Use a specific format to display numbers using Handsontable

I need to get Handsontable to display numbers with a specific format (e.g. 1.000.01), but it seems to ignore what I'm trying to use as a thousands separator.

I tried several ways to do this, but no one worked:

  • Format setting for cells that will contain numerical values cell.format = '0.0,00'
  • Setting the same format when creating an instance of my mobile object myTable.handsontable({ format: '0.0,00' })
  • Create a locale for delimited numeral.js { thousands: '.', decimal: ',' }
  • Changing the format used in working jsFiddle (from handsontable doc file), but I cannot get the desired display

Any idea what I am missing?

+4
source share
1 answer

You are right, numeraljs just aren't there yet, unfortunately. It works a little better if you use the format using square brackets, but it is still not perfect.

Here's a potential format string that seems to work in many cases, but not all:

0.0[,]00 $
0
source

Source: https://habr.com/ru/post/1619498/


All Articles