Skip to main content
Version: v3

getWeightUnit

Start from API_LEVEL 2.0 . Please refer to API_LEVEL.

Gets the weight unit set by the user.

Type

function getWeightUnit(): Result

Parameters

Result

TypeDescription
numberWeight units, value refer to weight unit constants

Constants

Weight unit constants

ConstantDescriptionAPI_LEVEL
WEIGHT_UNIT_KILOGRAMKilogram2.0
WEIGHT_UNIT_JINJin2.0
WEIGHT_UNIT_POUNDPound2.0
WEIGHT_UNIT_STONEStone2.0

Example

import { getWeightUnit, WEIGHT_UNIT_KILOGRAM } from '@zos/settings'

const weightUnit = getWeightUnit()

if (weightUnit === WEIGHT_UNIT_KILOGRAM) {
console.log('Kilogram')
}