Top "Decimal" questions

Decimal is the name for our common base-ten numeral system.

Remove trailing zeros

I have some fields returned by a collection as 2.4200 2.0044 2.0000 I want results like 2.42 2.0044 2 I tried with String.Format, but it …

c# .net decimal
Python: Converting string into decimal number

I have a python list with strings in this format: A1 = [' "29.0" ',' "65.2" ',' "75.2" '] How do I …

python string floating-point decimal
Python: Remove division decimal

I have made a program that divides numbers and then returns the number, But the thing is that when it …

python decimal division
percentage of two int?

I want to get two ints, one divided by the other to get a decimal or percentage. How can I …

java int decimal
Limit to 2 decimal places with a simple pipe

I have found an example which limits a number to 2 decimal places AND turns the figure into a currency amount- …

angular pipe decimal
Rounding a variable to two decimal places C#

I am interested in how to round variables to two decimal places. In the example below, the bonus is usually …

c# variables decimal rounding
DOUBLE vs DECIMAL in MySQL

OK, so I know there are tons of articles stating I shouldn't use DOUBLE to store money on a MySQL …

mysql double decimal
Cast a Double Variable to Decimal

How does one cast a double to decimal which is used when doing currency development. Where does the M go? …

c# casting decimal currency
What does the M stand for in C# Decimal literal notation?

In order to work with decimal data types, I have to do this with variable initialization: decimal aValue = 50.0M; What …

c# decimal literals
Float vs Decimal in ActiveRecord

Sometimes, Activerecord data types confuse me. Err, often. One of my eternal questions is, for a given case, Should I …

ruby-on-rails types floating-point decimal rails-activerecord