question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add formatNumber function

See original GitHub issue

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"

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
ShaileshSuryacommented, Jul 16, 2017

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

0reactions
shekhargulaticommented, Aug 29, 2017

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

FormatNumber Function - Microsoft Support
Formats the number values in "Discount" field into "Number" format with 2 decimal points, all less than 1 values will have "0" before...
Read more >
Power Automate: formatNumber function - Manuel T. Gomes
How to use the Power Automate “formatNumber "function? First, I'll explore the basics, tips, and tricks on using it efficiently in your ...
Read more >
VBScript FormatNumber Function - W3Schools
The FormatNumber function returns an expression formatted as a number. Syntax. FormatNumber(Expression[,NumDigAfterDec[, IncLeadingDig[,UseParForNegNum[, ...
Read more >
FormatNumber Function - ADM Help Centers
Returns an expression formatted as a number. FormatNumber(Expression [,NumDigitsAfterDecimal [,IncludeLeadingDigit [,UseParensForNegativeNumbers ...
Read more >
FormatNumber - The AMPscript Guide
This function formats a string as a number. Format patterns follow the C# format types outlined in the official Microsoft documentation:.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found