Skip to content

Commit

Permalink
fix(label): use round instead of floor to improve round trip conversi…
Browse files Browse the repository at this point in the history
…on between hex and label
  • Loading branch information
jdmorriso committed Dec 21, 2023
1 parent 1cddfc6 commit fb5ebd2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utility.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ export function label_to_Hu(s:string): number {
* */
export function JuMuHu_to_label(c:JuMuHu, precise=false): string {
const divisor = precise ? 1 : 10
return Math.floor(c.Ju/divisor)+Hu_to_label(c.Hu)+Math.floor(c.Mu*2/divisor)
return Math.round(c.Ju/divisor)+Hu_to_label(c.Hu)+Math.round(c.Mu*2/divisor)
}

/**
Expand Down

0 comments on commit fb5ebd2

Please sign in to comment.