Hi @adrian.szymanski
thank you for your quick response. I guess that sounds okay, about what I was expecting.
My current implementation is a node/npm app with Handsontable 16.01. and node 22. After some research I basically arrived at the identical setup to what is shown in this guide in the docs. But for me it doesn’t work.
So my HTML is loading my test.js file while inside test.js I have (adapted from the example in docs):
import 'node_modules/handsontable/dist/handsontable.full.min.js';
import numbro from 'node_modules/numbro/dist/es/numbro.js';
import deDE from 'node_modules/numbro/es/languages/de-DE.js';
import languages from 'node_modules/numbro/es/languages.js';
// either works with numbro directly but not with handsontable
numbro.registerLanguage(deDE);
//numbro.registerLanguage(languages["de-DE"]);
numbro.setLanguage("de-DE")
// Works
console.log(numbro(1234.678).format());
const formatDE = {
pattern: '0,0.00 $',
culture: 'de-DE',
};
const container = document.querySelector('#example3');
// Does not work; output format remains unchanged
new Handsontable(container, {
themeName: 'ht-theme-main',
data: [
{
productName: 'Product A',
JP_price: 1450.32,
TR_price: 202.14,
},
{
productName: 'Product B',
JP_price: 2430.22,
TR_price: 338.86,
},
{
productName: 'Product C',
JP_price: 3120.1,
TR_price: 435.2,
},
],
columns: [
{
data: 'productName',
type: 'text',
width: '150',
},
{
data: 'JP_price',
type: 'numeric',
width: '150',
numericFormat: formatDE,
},
{
data: 'TR_price',
type: 'numeric',
width: '150'
},
],
autoRowSize: false,
autoColumnSize: false,
columnSorting: true,
colHeaders: ['Product name', 'Price in Japan', 'Price in Turkey'],
height: 'auto',
autoWrapRow: true,
autoWrapCol: true,
licenseKey: 'non-commercial-and-evaluation',
});
Interestingly, if I include the numbro language file (not the ES version but the one in node_modules/numbro/dist/languages.min.js) in my html file it works but I’m trying to get it to work as an import.