Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
67
rated 0 times [  70] [ 3]  / answers: 1 / hits: 24059  / 15 Years ago, fri, february 5, 2010, 12:00:00

I need to round up to the nearest 0.10 with a minimum of 2.80



 var panel;
if (routeNodes.length > 0 && (panel = document.getElementById('distance')))
{
panel.innerHTML = (dist/1609.344).toFixed(2) + miles = £ + (((dist/1609.344 - 1) * 1.20) + 2.80).toFixed(2);
}


any help would be appreciated


More From » javascript

 Answers
35
var number = 123.123;

Math.max( Math.round(number * 10) / 10, 2.8 ).toFixed(2);

[#97656] Tuesday, February 2, 2010, 15 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
jennie

Total Points: 593
Total Questions: 102
Total Answers: 106

Location: Federated States of Micronesia
Member since Fri, Sep 16, 2022
2 Years ago
jennie questions
;