FAQ TWedge
How Can I Convert a Decimal (Float) to Integer?
How Can I Convert a Decimal (Float) to Integer?
My device sends 123.4 but I need only 123
Modify the script in the OnData event code (Ctrl - E). Replace the code lines with the following:
TWedge V2
var myData = Math.round(DATA).toFixed(); SendKeyStrokes(myData);
TWedge V3
var myData = DataToString(data); myData = Math.round(myData).toFixed(); SendKeyStrokes(myData);
This code will perform rounding. If you don't need rounding, replace the Math.round with Math.floor.
My balance sends grams but I need kilograms
Change your OnData event code to the following:
TWedge V2
var myData = (parseInt(DATA)/1000).toFixed(3); SendKeyStrokes(myData);
TWedge V3
var myData = DataToString(data); myData = (parseInt(myData)/1000).toFixed(3); SendKeyStrokes(myData);