1.0.2 • Published 4 years ago

@conquera99/qty-convert-tools v1.0.2

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

Qty Conversion Tools

This package for personal use only, but can be used and fork by anyone. This tools will help to convert string readable qty to unit qty and vice versa.

API

convertQty

Will convert given data with qty to readable quantity with given options, here is the available parameters:

ParametersTypeDefaultDescription
rowObjectrequiredobject data with given qty and uom, format with default prefix: {      transfer_qty: 5,      transfer_product_conversion: 60,      transfer_product_uom1: 'Krt',      transfer_product_uom2: 'Pcs',}note: qty will fallback to product_stock if not available
spacebooleantrueif false, will remove space from conversion result
uombooleanfalseif true, will show uom from given data and will ignore space arguments
prefixStringtransfer_prefix will be used to process data from row object

convertToUnitQty

Will convert from readable qty to unit qty with given conv arguments as qty conversion, here is the available parameters:

ParametersTypeDefaultDescription
qtyStringrequiredreadable qty with format: qtyUom1 . qtyUom2 or qtyUom1.qtyUom2
convNumberrequiredqty conversion number from uom1 to uom2