Top "Decimal-point" questions

The character or glyph used to separate the integer part from the fraction part in a decimal number.

Round to at most 2 decimal places (only if necessary)

I'd like to round at most 2 decimal places, but only if necessary. Input: 10 1.7777777 9.1 Output: 10 1.78 9.1 How can I do this in …

javascript rounding decimal-point
Formatting a number with exactly two decimals in JavaScript

I have this line of code which rounds my numbers to two decimal places. But I get numbers like this: 10.8, 2.4, …

javascript rounding decimal-point
How to change the decimal separator of DecimalFormat from comma to dot/point?

I have this little crazy method that converts BigDecimal values into nice and readable Strings. private String formatBigDecimal(BigDecimal bd){ …

java android bigdecimal decimal-point decimalformat
Leave only two decimal places after the dot

public void LoadAveragePingTime() { try { PingReply pingReply = pingClass.Send("logon.chronic-domination.com"); double AveragePing = (pingReply.RoundtripTime / 1.75); label4.Text = (AveragePing.ToString() + "ms"); } …

c# ping decimal-point
Integer.valueOf() vs. Integer.parseInt()

Aside from Integer.parseInt() handling the minus sign (as documented), are there any other differences between Integer.valueOf() and Integer.…

java string integer decimal-point
In jQuery, what's the best way of formatting a number to 2 decimal places?

This is what I have right now: $("#number").val(parseFloat($("#number").val()).toFixed(2)); It looks messy to me. I don't …

javascript jquery rounding decimal-point number-formatting
Javascript: formatting a rounded number to N decimals

in JavaScript, the typical way to round a number to N decimal places is something like: function roundNumber(num, dec) { …

javascript math rounding decimal-point
Int to Decimal Conversion - Insert decimal point at specified location

I have the following int 7122960 I need to convert it to 71229.60 Any ideas on how to convert the int into …

c# int decimal type-conversion decimal-point
Simplest way of getting the number of decimals in a number in JavaScript

Is there a better way of figuring out the number of decimals on a number than in my example? var …

javascript jquery numbers mootools decimal-point