Skip to content

Commit

Permalink
Fix rounding float to integer (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
sergioalen authored May 3, 2020
1 parent 1a6ec35 commit 14fd8a0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export function saveTypos(outDir: string, typos: string[], type: string) {

// covert float number to integer
export function floatToInt(float: number): number {
return Math.ceil(float * 255);
return Math.round(float * 255);
}

// convert interger to hex
Expand Down

0 comments on commit 14fd8a0

Please sign in to comment.