number-formatting Questions

4

Solved

I need to format a number in JavaScript with separators that may be defined at runtime. The combination of thousand and decimal separator may not match a specific locale. Is there a way to provi...
Trefoil asked 8/11, 2016 at 11:12

7

Solved

How can I, without using formulas, show integers as integers, but decimals limited to a specific number of decimal places? E.g. show: 1 as 1 12 as 12 but 1.23456789 as 1.23 The number format 0.## i...
Kv asked 24/4, 2018 at 17:29

2

Solved

When running console.log(new Intl.NumberFormat('en-US', { minimumFractionDigits: 0, maximumFractionDigits: 0, maximumSignificantDigits: 3, minimumSignificantDigits: 1 }).format(10.12...
Trouper asked 24/4, 2019 at 16:23

1

Solved

Currently trying to rework a .NET 4.8 MVC application to support globalization (needs to support both English and French). So far, everything has been working fine. The issue, however, is with deci...

31

Solved

How do I print an integer with commas as thousands separators? 1234567 ⟶ 1,234,567 It does not need to be locale-specific to decide between periods and commas.
Benjy asked 30/11, 2009 at 23:11

18

Solved

I have been storing phone numbers as longs and I would like to simply add hyphens when printing the phone number as a string. I tried using DecimalFormat but that doesn't like the hyphen. Probably...
Pacemaker asked 25/2, 2011 at 7:38

4

Solved

I have this $example = "1234567" $subtotal = number_format($example, 2, '.', ''); the return of $subtotal is "1234567.00" how to modify the definition of $subtotal, make it like this "1,234,567....
Apterous asked 22/7, 2013 at 5:42

17

Solved

How to format numbers like SO with C#? 10, 500, 5k, 42k, ...
Devolution asked 25/1, 2010 at 17:25

3

I want to format a currency with NumberFormat of Intl and get the returned value with a space " " between the symbol and the number. new Intl.NumberFormat('pt-br', { style: 'currency', cu...
Incantation asked 14/6, 2017 at 1:22

4

Solved

I'm trying to use a DOM coming from an external source, and in it there are some numeric values in Hindi/Arabic transcription, like "۱۶۶۰", and when I want to convert it into numeric valu...
Kulp asked 10/6, 2013 at 13:23

2

Solved

When I try to read the string "3.14" as a float using German Locale I expect one of two things to happen: (1) throw an error, because that is not a valid way to write 3.14 in German (2) ...
Megacycle asked 14/2, 2024 at 16:22

39

Solved

I would like to format my numbers to always display 2 decimal places, rounding where applicable. Examples: number display ------ ------- 1 1.00 1.341 1.34 1.345 1.35 I have been using this: p...
Stratigraphy asked 26/5, 2011 at 5:22

7

Solved

I'm new in the Swift world. How can I converting a String with a comma to a String with a decimal? The code work's fine with a dot (.) The problem is when I'm using a comma (,) ... with: var pri...
Ander asked 4/2, 2015 at 5:5

2

I have noticed that the formating of several countries (Poland, Russia, France and more) follows a strange behaviour. The format starts to apply on values with more that 4 digits. You can see it in...
Ddene asked 8/2, 2021 at 14:11

6

Solved

I have the following JavaScript code: var calculation = $('select[name=somevalue1] option:selected').data('calc')-($('select[name=somevalue1] option:selected').data('calc')/100*$('select[name=somev...
Preordain asked 24/3, 2017 at 5:53

4

I've an edittext , it only gets numeric without decimal numbers. android:inputType="number" I want to separate thousands while I'm typing . For example 25,000 . I know I should use TextWatche...

6

Is it possible to apply the 'Automatic' number format programmatically through GAS? My issue is that as I write columns of numbers, Sheets seems to attempt to apply appropriate formatting, but gets...
Lemmuela asked 26/6, 2016 at 20:5

16

Solved

I am using NumberFormat.getCurrencyInstance(myLocale) to get a custom currency format for a locale given by me. However, this always includes the currency symbol which I don't want, I just want the...
Helbonna asked 28/12, 2011 at 16:2

2

Solved

I am trying to format a NumberValue as a String in the current locale format. For example, for Locale.Germany these would be the results I am trying to get: 1 -> 1,00 1.1 -> 1,10 0.1 -> ...
Ratcliff asked 30/1, 2019 at 11:28

2

Solved

The Single UNIX Specification Version 2 specifies the sprintf's format '-flag behavior as: The integer portion of the result of a decimal conversion (%i, %d, %u, %f, %g or %G) will be formatted ...
Penrose asked 13/6, 2017 at 14:3

4

Solved

I have a script which returns a price for a product. However, the price may or may not include trailing zeros, so sometimes I might have 258.22 and other times I might have 258.2. In the latter cas...
Laminate asked 12/3, 2010 at 13:52

4

Solved

Is there a way with number_format() to leave out decimal places if the number is not a float/decimal? For example, I would like the following input/output combos: 50.8 => 50.8 50.23 => 50.2...
Irreformable asked 18/4, 2018 at 3:11

23

Solved

I have a question about formatting the Rupee currency (Indian Rupee - INR). For example, numbers here are represented as: 1 10 100 1,000 10,000 1,00,000 10,00,000 1,00,00,000 10,00,00,000 Refer In...
Endosteum asked 6/4, 2012 at 10:51

2

Solved

I already saw a lot of question teaching how easy is to do it with comma as thousands separator: >>> format(1123000,',d') '1,123,000' But if I try to use a dot, it goes nuts: >>&...

6

Solved

I am using freemarker and trying to display numbers in this format: $3,343,434.00 for example. This was easily taken care of by using ${total?string.currency} (assuming "total" is some number). H...
Ordovician asked 6/1, 2014 at 21:59

© 2022 - 2025 — McMap. All rights reserved.