Skip to content

Commit 7a3e381

Browse files
committed
Simplify conditional in readHundreds function
Reversed the ternary operator condition to improve code clarity and consistency with other similar functions. This adjustment maintains the original functionality while enhancing readability.
1 parent a6581da commit 7a3e381

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/read/three-digits.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { getDigitWord } from './digits.ts'
44
* Read the "hundreds" digit
55
*/
66
function readHundreds(first: string, hasHundredsPosition: boolean): string {
7-
return !hasHundredsPosition ? '' : `${getDigitWord(first)} trăm`
7+
return hasHundredsPosition ? `${getDigitWord(first)} trăm` : ''
88
}
99

1010
/**

0 commit comments

Comments
 (0)