Skip to content

Commit

Permalink
Round Price (#19)
Browse files Browse the repository at this point in the history
* round

* decimals, not sigfigs

* negative conversion
  • Loading branch information
ssnyder-intrinio authored Sep 15, 2022
1 parent 3e07dfb commit 314a1b3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ function readFloat32(bytes, float32Array, backingByteArray, startPos = 0) {
backingByteArray[1] = bytes[++startPos]
backingByteArray[2] = bytes[++startPos]
backingByteArray[3] = last
return float32Array[0]
let parsed = parseFloat(float32Array[0].toFixed(4))
return parsed < 0 ? 0 : parsed
}

function readUInt64(bytes, startPos = 0) {
Expand Down

0 comments on commit 314a1b3

Please sign in to comment.