2
0
mirror of https://github.com/frappe/books.git synced 2024-12-23 11:29:03 +00:00

feat: add locale for number formatting

This commit is contained in:
18alantom 2021-12-23 18:06:55 +05:30
parent e1f1ffd202
commit e3351e1e06
2 changed files with 10 additions and 0 deletions

View File

@ -3,6 +3,7 @@ const { _ } = require('frappejs/utils');
const {
DEFAULT_DISPLAY_PRECISION,
DEFAULT_INTERNAL_PRECISION,
DEFAULT_LOCALE,
} = require('../../../utils/consts');
let dateFormatOptions = (() => {
@ -43,6 +44,13 @@ module.exports = {
required: 1,
description: _('Sets the app-wide date display format.'),
},
{
fieldname: 'locale',
label: 'Locale',
fieldtype: 'Data',
default: DEFAULT_LOCALE,
description: _('Set the local code, this is used for number formatting.'),
},
{
fieldname: 'displayPrecision',
label: 'Display Precision',
@ -92,6 +100,7 @@ module.exports = {
],
quickEditFields: [
'dateFormat',
'locale',
'displayPrecision',
'hideGetStarted',
'autoUpdate',

View File

@ -1,2 +1,3 @@
export const DEFAULT_INTERNAL_PRECISION = 11;
export const DEFAULT_DISPLAY_PRECISION = 2;
export const DEFAULT_LOCALE = 'en-IN';