From 8feae8c4b07ef285cd8b11f67c07bf690e60b3b3 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Tue, 16 Mar 2021 22:47:47 +0000 Subject: [PATCH] --- ayanova/devdocs/todo.txt | 9 --------- ayanova/src/api/locale.js | 3 +++ 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/ayanova/devdocs/todo.txt b/ayanova/devdocs/todo.txt index 1b6bc420..f4928b30 100644 --- a/ayanova/devdocs/todo.txt +++ b/ayanova/devdocs/todo.txt @@ -59,15 +59,6 @@ todo: v8 migrate additions ## CLIENT MISC ITEMS -todo: Parts, fractional values?? should anywhere a quantity of part show be a decimal control and if so then should show no trailing zeros like v7? - The correct thing to do is ensure decimal numbers if entered display localized anywhere so bearing that in mind.... - (in v7 if you enter 1 it displays as 1 not 1.00, if you enter 1.25 then it displays as 1.25) - right now kind of using a mish mash where in some areas quantities are just raw numbers because I'm testing with integer values for things like parts so no seeing this - but if I force to use decimalLocalized then there are always 2 digits even when it's just .00 which is sort of ugly but sort of not ugly if they use that a lot in which case it would visually line up in grids - not sure what is the best way, maybe a setting? I do see there is a minimum digits for this Intl.NumberFormat(languageName, {minimumFractionDigits: 2}).format(value); - so maybe there's a setting to handle this gracefully?? - If so then I need to look back at any place showing fractional values potentially and ensure it's all standardized whatever way - todo: should user required rule (defined in form custom settings) show a variation of the required error message so that it's clear *they* defined it and they can unset it in customize? right now they could set a required rule, forget they set it then email us to bitch that it shouldn't be required todo: reports need duration display helper diff --git a/ayanova/src/api/locale.js b/ayanova/src/api/locale.js index 41b216e7..f7347c4d 100644 --- a/ayanova/src/api/locale.js +++ b/ayanova/src/api/locale.js @@ -298,9 +298,12 @@ export default { if (!languageName) { languageName = this.getBrowserLanguages(); } + //This forces 2 digits after the decimal // return new Intl.NumberFormat(languageName, { // minimumFractionDigits: 2 // }).format(value); + //this goes with whatever is the local format which for dev testing turned out to be perfect: 1.00 displays as 1 and 1.75 displays as 1.75 + //alignment goes out the window but it follows v7 format return new Intl.NumberFormat(languageName).format(value); }, ///////////////////////////////////////////