How JustAnswer Works:
  • Ask an Expert
    Experts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional Answer
    Via email, text message, or notification as you wait on our site. Ask follow up questions if you need to.
  • 100% Satisfaction Guarantee
    Rate the answer you receive.
Ask ATLPROG Your Own Question
ATLPROG
ATLPROG, Computer Software Engineer
Category: Programming
Satisfied Customers: 7677
Experience:  MS in IT.Several years of programming experience in Java C++ C C# Python VB Javascript HTML
44910485
Type Your Programming Question Here...
ATLPROG is online now
A new question is answered every 9 seconds

FUNCTION roundValue(value, decimalPlaces)' Round the

Customer Question

FUNCTION roundValue(value, decimalPlaces)
' Round the incoming value
value = 0
count = 0;
magnitude = 1
FOR count = 1 TO decimalPlaces
magnitude = magnitude * 10
END FOR
value = (value + 0.5) * magnitude) / magnitude;
return value
END FUNCTION
JA: What programs and versions are you using?
Customer: notepad++
JA: What is your ideal outcome? How can we solve this for you?
Customer: i wan to convert this to c programming
JA: Anything else you want the programmer to know before I connect you?
Customer: it is the rounded value with 3 decimal places and if value is less than 0 then make it 0 and if value is grater than 2.5 make it 2.5
Submitted: 1 month ago.
Category: Programming
Customer: replied 1 month ago.
i just want coding for rounded data with 3 decimal places and if value is less than 0 then make it 0 and if value is grater than 2.5 make it 2.5
Expert:  LogicPro replied 1 month ago.
Hi