tagged [decimal]
Python: Converting string into decimal number
Python: Converting string into decimal number I have a python list with strings in this format: How do I convert those strings into decimal numbers to perform arithmetic operations on the list element...
- Modified
- 20 Dec at 21:42
Decimal.TryParse doesn't parse my decimal value
Decimal.TryParse doesn't parse my decimal value When I tried to convert something like 0.1 (from user in textbox), My value b is always false. How can it be here to work?
How to round to at most 2 decimal places, if necessary
How to round to at most 2 decimal places, if necessary I'd like to round at most two decimal places, but . Input: Output: How can I do this in JavaScript?
- Modified
- 5 May at 15:28
How to convert a decimal number into fraction?
How to convert a decimal number into fraction? I was wondering how to convert a decimal into a fraction in its lowest form in Python. For example:
Remove trailing zeros from decimal in SQL Server
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 to remove those ...
- Modified
- 30 May at 17:59
Regular expression for decimal number
Regular expression for decimal number I need to validate a `textbox` input and can only allow decimal inputs like: `X,XXX` (only one digit before decimal sign and a precision of 3). I'm using C# and t...
Percentage in StringFormat
Percentage in StringFormat I have a technical problem with using percentage in `StringFormat` method. The result of `String.Format("{0:P}", 0.8526)` is `85.26%` but I think it should be `0.8526%` Is i...
- Modified
- 17 Mar at 15:28
Remove 0s from the end of a decimal value
Remove 0s from the end of a decimal value I have a decimal value that has a variable number of digits after the `.`, for example: How can I write a dynamic function that removes 0 in the end of the de...
Remove trailing zeros
Remove trailing zeros I have some fields returned by a collection as I want results like I tried with `String.Format`, but it returns `2.0000` and setting it to `N0` rounds the other values as well.
How to round decimal value up to nearest 0.05 value?
How to round decimal value up to nearest 0.05 value? Is there any way to round up decimal value to its nearest 0.05 value in .Net? Ex: 7.125 -> 7.15 6.66 -> 6.7 If its now available can anyone provide...
Decimal ToString() conversion issue in C#
Decimal ToString() conversion issue in C# I am facing a problem when I try to convert `decimal?` to `string`. Scenario is Current Result : value = 12.1100 Expected Result : value = 12.11 Please let me...
Convert string to decimal with format
Convert string to decimal with format I need convert a String to a decimal in C#, but this string have different formats. For example: "50085" "500,85" "500.85" This should be convert for 500,85 in de...
Remove useless zero digits from decimals in PHP
Remove useless zero digits from decimals in PHP I'm trying to find a fast way to remove `zero decimals` from number values like this: Does exists some optimized way to do that?
How to convert Decimal to Double in C#?
How to convert Decimal to Double in C#? I want to assign the decimal variable "trans" to the double variable "this.Opacity". When I build the app it gives the following error: > Cannot implicitly conv...
- Modified
- 8 Sep at 05:7
Performing Math operations on decimal datatype in C#?
Performing Math operations on decimal datatype in C#? I was wondering if the above was at all possible. For example: When looking at the overload, it requires a double parameter, so I'm not sure if th...
Python: Remove division 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 returns the number it has a decimal like this: But I want it to gi...
C# decimal separator?
C# decimal separator? I have a method which returns numbers like this: Now when this value is printed to the console for example, it has a comma (250,00) instead of a point (250.00). I always want a p...
Limit to 2 decimal places with a simple pipe
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- eg £2.55. Is there a simple pipe which does ...
Convert decimal to binary in python
Convert decimal to binary in python Is there any module or function in python I can use to convert a decimal number to its binary equivalent? I am able to convert binary to decimal using int('[binary_...
Decimal precision and scale in EF Code First
Decimal precision and scale in EF Code First I'm experimenting with this code-first approach, but I'm find out now that a property of type System.Decimal gets mapped to a sql column of type decimal(18...
- Modified
- 25 Jan at 01:8
Round a decimal to the nearest quarter in C#
Round a decimal to the nearest quarter in C# Is there a simple way in c# to round a decimal to the nearest quarter i.e. x.0, x.25, x.50 x.75 for example 0.21 would round to 0.25, 5.03 would round to 5...
Decimal separator comma (',') with numberDecimal inputType in EditText
Decimal separator comma (',') with numberDecimal inputType in EditText The `inputType` `numberDecimal` in `EditText` uses the dot `.` as decimal separator. In Europe it's common to use a comma `,` ins...
- Modified
- 17 Feb at 17:10
Parse decimal and filter extra 0 on the right?
Parse decimal and filter extra 0 on the right? From a XML file I receive decimals on the format: Currently I am using Decimal.Parse like this: - How do print myDecimal to string to look like below ?
range() for floats
range() for floats Is there a `range()` equivalent for floats in Python?
Format decimal for percentage values?
Format decimal for percentage values? What I want is something like this: Where %% is that format provider or whatever I am looking for. Should result: `Value: %85.26.`. I basically need it for wpf bi...
- Modified
- 6 Jan at 08:46