/
Multiply and Truncate

© 2025 IQVIA - All Rights Reserved

Multiply and Truncate

Equation

Multiply input by 10 and truncate the last decimal place.

For example, if input = 0.14

0.14 x 10 = 1.40

Truncate last decimal for result of 1.4

Example Form Setup

Formal Expression

var SOURCE_VALUE_ITEM_NAME = 'LB_Alcohol Test Results Day 1'; var repeatKey = itemJson.item.itemGroupRepeatKey; var origItem = findFirstItemByName(formJson, SOURCE_VALUE_ITEM_NAME, null, repeatKey); var origValue = origItem.value; var origDecimalPlaces = countDecimals(origValue); var newValue = origValue * 10; newValue = newValue.toFixed(origDecimalPlaces - 1); return newValue; function countDecimals(number) { if(Math.floor(number) === number) return 0; return number.toString().split(".")[1].length || 0; }

 

Related content

BMI Calculation
BMI Calculation
More like this
Populate Item Barcode(s) or Sample Transfer Barcode(s) from the same Form into a Specific Item
Populate Item Barcode(s) or Sample Transfer Barcode(s) from the same Form into a Specific Item
Read with this
Additive Calculation
Additive Calculation
More like this
RECIST Change
RECIST Change
More like this
Return a Unique Incremental ID Number
Return a Unique Incremental ID Number
More like this
Out Of Range Item Data in Item Group
Out Of Range Item Data in Item Group
More like this

Exported and Printed Copies Are Uncontrolled