python (65.2k questions)
javascript (44.3k questions)
reactjs (22.7k questions)
java (20.8k questions)
c# (17.4k questions)
html (16.3k questions)
r (13.7k questions)
android (13k questions)
Formatting variable of type double when declaring it
I'm aware of the many ways of formatting a double variable to X # of decimal places. With that being said:
static double currentSelectedPrice = 0.00; //format to 2 decimal places
static double usercas...

codeinsteinn
Votes: 0
Answers: 2
DecimalFormat rounding issue?
Am I doing something terribly wrong or does DecimalFormat really have an issue with rounding?
DecimalFormat format = new DecimalFormat("#.####");
format.setRoundingMode(RoundingMode.HALF_UP)...
flitzpiepe96
Votes: 0
Answers: 0
How do I reduce the digits of an incoming multi-digit decimal number from API in Kotlin?
I'm getting a price value from an API but it's a multi-digits decimal number like 0.4785835398457. I want to reduce this number to 3 or 4 digits number like 0.3234 and I'm showing that value in a Text...
Sevban Bayır
Votes: 0
Answers: 2
JavaScript : How to format the amount decimal to 2 digits
I tried to format the Amount field to 2 digits using the
Amount.toLocaleString()
toLocaleString(undefined, { minimumFractionDigits: 2 }),
Some of the Amount values are displayed correctly but few are...
Mohammad Asif
Votes: 0
Answers: 2