2 Replies - 1055 Views - Last Post: 12 September 2010 - 07:24 AM Rate Topic: -----

#1 Saboi  Icon User is offline

  • New D.I.C Head

Reputation: -2
  • View blog
  • Posts: 33
  • Joined: 23-May 07

Rounding of Decimals

Posted 10 September 2010 - 09:45 AM

Hi guys,

The calculations on my program give results such as 3.6666666 and 1.888888. What i would like to do is limit the numbers to 3.66 and 1.88. Limit the numbers after the decimal point to two digits.

How can this be done on principle.

Thank you guys.

Saboi
Is This A Good Question/Topic? 0
  • +

Replies To: Rounding of Decimals

#2 maj3091  Icon User is online

  • D.I.C Lover
  • member icon

Reputation: 299
  • View blog
  • Posts: 1,768
  • Joined: 26-March 09

Re: Rounding of Decimals

Posted 10 September 2010 - 09:55 AM

Look into using the round function.

A good tutorial on handling numeric types is in the tutorial section here
Was This Post Helpful? 0
  • +
  • -

#3 Saboi  Icon User is offline

  • New D.I.C Head

Reputation: -2
  • View blog
  • Posts: 33
  • Joined: 23-May 07

Re: Rounding of Decimals

Posted 12 September 2010 - 07:24 AM

Hello maj3091,

The round function worked just fine, thanks.

Saboi
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1