mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Simple localization support and currency selector.
Summary: - Grist document has a associated "locale" setting that affects how currency is formatted. - Currency selector for number format. Test Plan: not done Reviewers: dsagal Reviewed By: dsagal Subscribers: paulfitz Differential Revision: https://phab.getgrist.com/D2977
This commit is contained in:
@@ -14,8 +14,11 @@ export class Spinner extends NumericTextBox {
|
||||
|
||||
constructor(field: ViewFieldRec) {
|
||||
super(field);
|
||||
const resolved = this.autoDispose(ko.computed(() =>
|
||||
buildNumberFormat({numMode: this.options().numMode}).resolvedOptions()));
|
||||
const resolved = this.autoDispose(ko.computed(() => {
|
||||
const {numMode} = this.options();
|
||||
const docSettings = this.field.documentSettings();
|
||||
return buildNumberFormat({numMode}, docSettings).resolvedOptions();
|
||||
}));
|
||||
this._stepSize = this.autoDispose(ko.computed(() => {
|
||||
const extraScaling = (this.options().numMode === 'percent') ? 2 : 0;
|
||||
return Math.pow(10, -(this.options().decimals || resolved().minimumFractionDigits) - extraScaling);
|
||||
|
||||
Reference in New Issue
Block a user