parseToQuantityValue Method
parseToQuantityValue(props)
Parse input string asynchronously into a quantity given the provided properties.
parseToQuantityValue(props: { kindOfQuantityName: string, value: string, valueUnitName: string }): Promise<QuantityParseResult>
@returns Promise resolving to a QuantityParseResult object containing either the parsed value or an error value if unsuccessful.
Parameter | Type | Description |
---|---|---|
props | { kindOfQuantityName: string, value: string, valueUnitName: string } | an object containing value, valueUnitName, and kindOfQuantityName. |
Returns - Promise<QuantityParseResult>
Promise resolving to a QuantityParseResult object containing either the parsed value or an error value if unsuccessful.
parseToQuantityValue(inString, parserSpec?)
Parse input string into quantity given the ParserSpec
parseToQuantityValue(inString: string, parserSpec?: ParserSpec): QuantityParseResult
@returns QuantityParseResult object containing either the parsed value or an error value if unsuccessful.
Parameter | Type | Description |
---|---|---|
inString | string | The magnitude of the quantity. |
parserSpec | ParserSpec | The parse specification the defines the expected format of the string and the conversion to the output unit. |
Returns - QuantityParseResult
QuantityParseResult object containing either the parsed value or an error value if unsuccessful.
Defined in
Last Updated: 07 June, 2025