truncating

1. Senior Member
Join Date
Dec 1969
Posts
189

## truncating

Hi guys,<BR> Well this might be a very basic question . I have a value which is integer for eg -15.575757575. <BR>how do i make it display as -15.57 <BR><BR>Thanks <BR><BR>Kiran<BR>ss_kiran@yahoo.com

2. Senior Member
Join Date
Dec 1969
Posts
1,013

## RE: truncating

There&#039;s no way that I&#039;d classify -15.575757575 as an integer... :)<BR><BR>Chris

3. Senior Member
Join Date
Dec 1969
Posts
189

## RE: truncating

Ok sorry about that but could u tell how do i do the same .<BR><BR>Thanks Kiran<BR>

4. Senior Member
Join Date
Dec 1969
Posts
1,013

## RE: truncating

I don&#039;t know if there&#039;s a function to do this, but this will round the number to 2 decimal places...<BR><BR>MyNum = Int(MyNum * 100 + 0.5) / 100<BR><BR>HTH<BR>Chris

5. John D Guest

## Know what you are talking about

Use this function:<BR>FormatNumber(YourNumber,NumberOfDecim alsYouWant)<BR><BR>

6. Senior Member
Join Date
Dec 1969
Posts
1,013

## RE: Know what you are talking about

Nice, much simpler :)<BR>That&#039;s the way I do things though... don&#039;t know how to do something? Invent a way. It&#039;s great when you&#039;re being paid by the hour ;)<BR><BR>Chris

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•