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:
co-authored by
Jose Alberto Hernandez
parent
814bb87c16
commit
99c2d4780d
@@ -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
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user