Questions tagged as 'arredondamento'

2
answers

How do I round numbers to the nearest integer?

I have double numbers as double a = 0.4, b = 0.5; How do I round up?     
asked by 21.12.2013 / 17:59
1
answer

Roundup of 5 in 5 cents

In a PHP system I'm developing, I need to update a column of the price table. The price field is in float format and the administrator informs the percentage of increase. Example: Reports that it will have a 10% increase. $valor_anti...
asked by 27.02.2016 / 16:17
1
answer

Float with PHP precision

I am bringing the sum of the values from the database and as a result it returns me according to the example below:    6.3285714285714 I would like it to look like this:    6.32 I've tried ceil() and round() , but both...
asked by 25.07.2018 / 22:51
3
answers

Round numbers in C # being the decimal place 0 or 5

I need to round numbers in such a way that they have only one decimal place worth 0 or 5. For example 1 -> 1 1.1 -> 1.5 1.4 -> 1.5 1.5 -> 1.5 1.6 -> 2 2 -> 2 Does anyone know of a simple way to do this?     
asked by 17.05.2014 / 18:29
1
answer

Floating Point Error

Here is the code for the total price that is giving the floating-point error ': //Pr. Total sgItens.Cells[5,l] := FormatFloat('###,###,###,##0.00',StrToFloat(copy(lTemp, 210, 14))); cont:= StrToFloat(sgItens.Cells[5,l]); valorTotal:= valorT...
asked by 08.05.2014 / 19:51
1
answer

Method Math.Round does not round correctly

I'm having problems with the Math.Round() method in C #, some values that it does not round properly, I'll give some examples: Math.Round(1190.245, 2) 1190.245 it should round to 1190.25 since it ends with 5 and the 5 i...
asked by 06.02.2018 / 20:29
1
answer

Decimal house - JQuery

Good afternoon! The code below performs the calculation of the mean, however, depending on the value it gets periodic decimal, how to round the values in decimal places, for example 0.00 or 00.00? Thank you. HTML: Nota 1: <input class="n...
asked by 25.04.2016 / 21:35
1
answer

How do I round the third decimal place in php?

I need some help, I have the following problem, I need to round the third decimal place up, how do I do it? EX: From 3.49 converts to 3.50 From 3.48 converts to 3.50 From 3.43 converts to 3.50 From 3.42 converts to 3.50 When I use the f...
asked by 06.07.2017 / 16:47
2
answers

How to truncate decimal to X decimal places? [closed]

I'm using the following code, but when I send ex: '10 .100 'to 2 houses it returns '10 .1', but should be '10 .10 ' public decimal TruncarDecimal(decimal value, int decimalPlaces) { decimal integralValue = Math.Truncate(value);...
asked by 19.09.2017 / 16:58
1
answer

How to use the python round

When I use the python round it converts 1.5 to 2, but with 2.5 it leaves 2. How do I round 2.5 to 3? Being that any other number that does not contain the number 2 it rounds right     
asked by 02.02.2018 / 18:03