
pl.allegro.finance.tradukisto.internal.support.JapaneseNumberChunking Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of tradukisto Show documentation
Show all versions of tradukisto Show documentation
Small java library created to convert numbers to their word representations
The newest version!
package pl.allegro.finance.tradukisto.internal.support;
import java.util.LinkedList;
import java.util.List;
public class JapaneseNumberChunking extends NumberChunking {
private static final int JAPANESE_SPLIT_FACTOR = 1_0000;
@Override
public List chunk(Long value) {
LinkedList result = new LinkedList<>();
while (value > 0) {
result.addFirst((int) (value % JAPANESE_SPLIT_FACTOR));
value /= JAPANESE_SPLIT_FACTOR;
}
return result;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy