All Downloads are FREE. Search and download functionalities are using the official Maven repository.

pl.allegro.finance.tradukisto.internal.support.JapaneseNumberChunking Maven / Gradle / Ivy

Go to download

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