Skip to content

Commit

Permalink
Fikset overflødig komma i navn ved ,00
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgengaldal committed Aug 28, 2023
1 parent f96370d commit 0be4346
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion number2text.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,13 @@ export function convertNumberWithComma(num) {
let beforeComma = parseInt(numberStrings[0]);
let afterComma = parseInt(numberStrings[1]);

return convertNumber(beforeComma) + "komma" + convertNumber(afterComma);
if (afterComma != 0) {
return convertNumber(beforeComma) + "komma" + convertNumber(afterComma)
}
else {
return convertNumber(beforeComma)
}

}

export function convertNumber(num) {
Expand Down

0 comments on commit 0be4346

Please sign in to comment.