Add support for European numeric formats #1

Closed
opened 2023-07-13 12:19:29 +00:00 by mihajlo · 4 comments
Owner

In the EDIT screen, depending on the locale, use commas instead of periods to seperate the decimal places

In the EDIT screen, depending on the locale, use commas instead of periods to seperate the decimal places
mihajlo reopened this issue 2023-07-13 12:19:44 +00:00
mihajlo started working 2023-07-13 12:19:54 +00:00
mihajlo canceled time tracking 2023-07-13 12:20:04 +00:00
mihajlo self-assigned this 2023-07-13 12:20:16 +00:00
mihajlo added the
enhancement
label 2023-07-13 12:21:16 +00:00
Author
Owner

https://jsfiddle.net/handsoncode/xbj2g41z/

Hot config:

columns: [
  {
    data: 'column name',
    type: 'numeric',
    numericFormat: {
      pattern: '0,0.00 $',
      culture: 'de-DE' // use this for EUR (German),
      // more cultures available on http://numbrojs.com/languages.html
    }
  }
]
https://jsfiddle.net/handsoncode/xbj2g41z/ Hot config: ``` columns: [ { data: 'column name', type: 'numeric', numericFormat: { pattern: '0,0.00 $', culture: 'de-DE' // use this for EUR (German), // more cultures available on http://numbrojs.com/languages.html } } ] ```
Author
Owner

HOT does not apply the format for some reason, the workaround is to register language with numbro manually:

https://forum.handsontable.com/t/change-decimal-separator-from-to/2414/3

HOT does not apply the format for some reason, the workaround is to register language with numbro manually: https://forum.handsontable.com/t/change-decimal-separator-from-to/2414/3
Author
Owner

Error for workaround:

import germanLanguage from 'numbro/dist/languages/de-DE.min'

Error message:

Could not find a declaration file for module 'numbro/dist/languages/de-DE.min'. '/home/mihajlo/external-projects/allan/gitea_repos/dc/client/node_modules/numbro/dist/languages/de-DE.min.js' implicitly has an 'any' type.
  If the 'numbro' package actually exposes this module, try adding a new declaration (.d.ts) file containing `declare module 'numbro/dist/languages/de-DE.min';`ts(7016)

Discussion:
https://github.com/BenjaminVanRyseghem/numbro/issues/576

Error for workaround: ``` import germanLanguage from 'numbro/dist/languages/de-DE.min' ``` Error message: ``` Could not find a declaration file for module 'numbro/dist/languages/de-DE.min'. '/home/mihajlo/external-projects/allan/gitea_repos/dc/client/node_modules/numbro/dist/languages/de-DE.min.js' implicitly has an 'any' type. If the 'numbro' package actually exposes this module, try adding a new declaration (.d.ts) file containing `declare module 'numbro/dist/languages/de-DE.min';`ts(7016) ``` Discussion: https://github.com/BenjaminVanRyseghem/numbro/issues/576
Owner

linked PR: #16

linked PR: https://git.datacontroller.io/dc/dc/pulls/16
allan closed this issue 2023-08-23 14:47:36 +00:00
Sign in to join this conversation.
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: dc/dc#1
No description provided.