This commit is contained in:
@ -63,8 +63,8 @@ import {
|
||||
} from './utils/renderers.utils'
|
||||
import { isStringDecimal, isStringNumber } from './utils/types.utils'
|
||||
import { LicenceService } from '../services/licence.service'
|
||||
import * as numbro from 'numbro';
|
||||
import * as languages from 'numbro/dist/languages.min';
|
||||
import * as numbro from 'numbro'
|
||||
import * as languages from 'numbro/dist/languages.min'
|
||||
|
||||
@Component({
|
||||
selector: 'app-editor',
|
||||
@ -365,7 +365,8 @@ export class EditorComponent implements OnInit, AfterViewInit {
|
||||
private hotRegisterer: HotTableRegisterer
|
||||
) {
|
||||
const lang = languages[window.navigator.language]
|
||||
if (lang) numbro.default.registerLanguage(languages[window.navigator.language])
|
||||
if (lang)
|
||||
numbro.default.registerLanguage(languages[window.navigator.language])
|
||||
|
||||
this.hotRegisterer = new HotTableRegisterer()
|
||||
|
||||
|
@ -1,22 +1,21 @@
|
||||
import { DcValidation } from '../models/dc-validation.model'
|
||||
import * as languages from 'numbro/dist/languages.min';
|
||||
import * as languages from 'numbro/dist/languages.min'
|
||||
/**
|
||||
* Applying the numeric formats based on the browser locale/language
|
||||
* @param rules rules to be updated
|
||||
*/
|
||||
export const applyNumericFormats = (
|
||||
rules: DcValidation[]
|
||||
): DcValidation[] => {
|
||||
export const applyNumericFormats = (rules: DcValidation[]): DcValidation[] => {
|
||||
const lang = languages[window.navigator.language]
|
||||
|
||||
if (!lang) return rules
|
||||
|
||||
for (let rule of rules) {
|
||||
if (rule.type === 'numeric') rule.numericFormat = {
|
||||
pattern: '0,0',
|
||||
culture: window.navigator.language // use this for EUR (German),
|
||||
// more cultures available on http://numbrojs.com/languages.html
|
||||
}
|
||||
if (rule.type === 'numeric')
|
||||
rule.numericFormat = {
|
||||
pattern: '0,0',
|
||||
culture: window.navigator.language // use this for EUR (German),
|
||||
// more cultures available on http://numbrojs.com/languages.html
|
||||
}
|
||||
}
|
||||
|
||||
return rules
|
||||
|
@ -18,4 +18,4 @@ In any case, you must not make any such use of this software as to develop softw
|
||||
UNLESS EXPRESSLY AGREED OTHERWISE, 4GL APPS PROVIDES THIS SOFTWARE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, AND IN NO EVENT AND UNDER NO LEGAL THEORY, SHALL 4GL APPS BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER ARISING FROM USE OR INABILITY TO USE THIS SOFTWARE.
|
||||
|
||||
|
||||
`
|
||||
`
|
||||
|
Reference in New Issue
Block a user