shekhargulati / strman-java

A Java 8 string manipulation library.

Home Page:https://shekhargulati.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add formatNumber function

shekhargulati opened this issue · comments

The function will have following signature

public static String formatNumber(long number)
public static String formatNumber(long number, NumberFormatOptions options)

Test cases it should pass:

formatNumber(1000) // "1,000"
formatNumber(1000, NumberFormatOptions(2)) // "1000.00"
formatNumber(1000.754,NumberFormatOptions(0, "," , ".")) // "1.001"
formatNumber(1000000.754, NumberFormatIOptions(2, "," , ".")) // "1.000.000,75"

Please specify formatNumber(1000) //"1,000"
what about formatNumber(100000)=?
and formatNumber(10000000)=?
Also for formatOptions( ) NumberFormatOptions?
please give more test cases?

Unfortunately this project has some issues underspecified and we cannot take over them without having to go back and forth with @shekhargulati :(

Would you still be interested in a pull request for this feature?

@ssshailesh28 @flube2 please submit the PR. I am not again PR. The point is we all discuss what should the function do.