Closed JanCBrammer closed 3 months ago
b79d535
during Continuous Integration #2916Summary coverage rate: lines......: 64.1% (13672 of 21316 lines) functions..: no data found branches...: no data found Files changed coverage rate: n/a
59e2d74
during Continuous Integration #2967Summary coverage rate: lines......: 64.1% (13672 of 21316 lines) functions..: no data found branches...: no data found Files changed coverage rate: n/a
0665a60
during Continuous Integration #2971Summary coverage rate: lines......: 64.1% (13672 of 21316 lines) functions..: no data found branches...: no data found Files changed coverage rate: n/a
This PR addresses #1948.
The reaction variations table accepts only a period (i.e., ".") as decimal separator for numeric entries. The goal is to allow a comma and period as decimal separators. In the current codebase, there are at least two ways to achieve this.
1. Using the JavaScript package
numeral
The package is used in the
NumeralInput
component (which in turn is used in "Elemental composition" section ofSampleDetails
component viaElementalCompositionCustom
andElementalCompositionGroup
components). I decided not to usenumeral
:2. Custom logic in the
handleInputValueChange
method of theNumeralInputWithUnitsCompo
componentI decided against using the custom logic:
Since the JavaScript standard library doesn't offer locale-specific number parsing / parsing different decimal separators (see https://stackoverflow.com/a/42000120 and https://stackoverflow.com/questions/55364947/is-there-any-javascript-standard-api-to-parse-to-number-according-to-locale), I'm adding a dependency-free solution that could ideally be re-used to replace solutions 1. and 2. (in a separate PR).