fix measurementOrPercentValue definition to include UniversalMeasure values

This commit is contained in:
Tom Hunkapiller
2021-05-25 05:05:33 +03:00
parent 3a02bc087c
commit da61a30eb8

View File

@ -183,7 +183,13 @@ export function percentageValue(val: string): string {
// </xsd:simpleType>
export function measurementOrPercentValue(val: number | string): number | string {
return typeof val === "number" ? decimalNumber(val) : percentageValue(val);
if (typeof val === "number") {
return decimalNumber(val);
}
if (val.slice(-1) === '%') {
return percentageValue(val);
}
return universalMeasureValue(val);
}
// <xsd:simpleType name="ST_EighthPointMeasure">