Use of Decimals to Display user setting to format numbers (#1695)

Co-authored-by: Jose Alberto Hernandez <alberto@MacBook-Pro.local>
This commit is contained in:
José Alberto Hernández
2023-03-06 07:56:43 -06:00
committed by GitHub
co-authored by Jose Alberto Hernandez
parent 814bb87c16
commit 99c2d4780d
48 changed files with 242 additions and 166 deletions
+18
View File
@@ -40,6 +40,14 @@ export class SettingsService {
localStorage.setItem('mifosXLanguage', JSON.stringify(language));
}
/**
* Sets decimals to Display throughout the app.
* @param {string} decimals.
*/
setDecimalToDisplay(decimals: string) {
localStorage.setItem('mifosXDecimalsToDisplay', decimals);
}
setDefaultLanguage() {
const defaultLanguage = environment.defaultLanguage ? environment.defaultLanguage : 'en-US';
this.setLanguage({
@@ -113,6 +121,16 @@ export class SettingsService {
return JSON.parse(localStorage.getItem('mifosXLanguage'));
}
/**
* Returns Decimals to Display setting
*/
get decimals() {
if (!localStorage.getItem('mifosXDecimalsToDisplay')) {
return '2';
}
return localStorage.getItem('mifosXDecimalsToDisplay');
}
/**
* Returns list of default server
*/