Top "Decimal" questions

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

How do I interpret precision and scale of a number in a database?

I have the following column specified in a database: decimal(5,2) How does one interpret this? According to the properties on …

sql database decimal scale precision
Get decimal portion of a number with JavaScript

I have float numbers like 3.2 and 1.6. I need to separate the number into the integer and decimal part. For example, …

javascript floating-point numbers decimal rounding
How to calculate difference in hours (decimal) between two dates in SQL Server?

I have to calculate the difference in hours (decimal type) between two dates in SQL Server 2008. I couldn't find any …

sql-server tsql datetime decimal
Remove trailing zeros from decimal in SQL Server

I have a column DECIMAL(9,6) i.e. it supports values like 999,123456. But when I insert data like 123,4567 it becomes 123,456700 How …

sql tsql sql-server-2008 formatting decimal
range() for floats

Is there a range() equivalent for floats in Python? >>> range(0.5,5,1.5) [0, 1, 2, 3, 4] >>> range(0.5,5,0.5) Traceback (most recent …

python range fractions decimal
Python convert decimal to hex

I have a function here that converts decimal to hex but it prints it in reverse order. How would I …

python function decimal hex
Convert a string to integer with decimal in Python

I have a string in the format: 'nn.nnnnn' in Python, and I'd like to convert it to an integer. …

python string integer decimal
How can I format a String number to have commas and round?

What is the best way to format the following number that is given to me as a String? String number = "1000500000.574" //…

java string numbers decimal number-formatting
Python JSON serialize a Decimal object

I have a Decimal('3.9') as part of an object, and wish to encode this to a JSON string …

python json floating-point decimal
How to extract the decimal part from a floating point number in C?

How can we extract the decimal part of a floating point number and store the decimal part and the integer …

c floating-point decimal numbers