PC Review


Reply
Thread Tools Rate Thread

Decimal Places

 
 
David
Guest
Posts: n/a
 
      14th Dec 2007
Hi

I've a calculation in Excel VBA and it defaults to giving the result
up to 11 decimal places. I need it to be accurate to 16 decimal
places. Can this be done and if so how?

Here's the calculation:

cur_interestPart1 = (cur_balance - cur_offset_amount) * ((int_rate1 /
365) * (int_days_of_interest - int_days_of_interest_hols))

Thanks.
 
Reply With Quote
 
 
 
 
Carim
Guest
Posts: n/a
 
      14th Dec 2007
Hi,

Just use instruction :

cur_interestPart1.NumberFormat = "#,##0.0000000000000000"

HTH
 
Reply With Quote
 
David
Guest
Posts: n/a
 
      14th Dec 2007
Hi, thanks but I get an error:

"Compile Error: Invalid Qualifier"

The variables had been dimensioned as doubles, so I commented out
those lines and now I get:

"Object required"

Any ideas? Thanks.

 
Reply With Quote
 
Niek Otten
Guest
Posts: n/a
 
      14th Dec 2007
Hi David,

Excel's precision is 15 decimal digits. So if the integer part of the number is 4 places, there's only 11 left for the fraction.

Look here:

http://www.cpearson.com/excel/rounding.htm

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

"David" <(E-Mail Removed)> wrote in message news:71e14214-ed37-42cb-86e4-(E-Mail Removed)...
| Hi
|
| I've a calculation in Excel VBA and it defaults to giving the result
| up to 11 decimal places. I need it to be accurate to 16 decimal
| places. Can this be done and if so how?
|
| Here's the calculation:
|
| cur_interestPart1 = (cur_balance - cur_offset_amount) * ((int_rate1 /
| 365) * (int_days_of_interest - int_days_of_interest_hols))
|
| Thanks.


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Text box formatted to General Number with 2 decimal places NOTallowing the decimal place. p-rat Microsoft Access Form Coding 3 14th Jan 2008 05:20 PM
Subtracting two 2-decimal place numbers gives result 13-decimal places? tsdutcher@earthlink.net Microsoft Excel Worksheet Functions 5 12th Mar 2007 10:38 PM
Re: conditionally round decimal numbers from 8 places to 6 places pietlinden@hotmail.com Microsoft Access Queries 0 16th Jan 2007 07:09 PM
decimal places in acces more than 2 places when importing an excel =?Utf-8?B?cm9iZXJ0cm9iZXJ0cm9iZXJ0cm9iZXJ0?= Microsoft Outlook Discussion 2 28th Sep 2005 04:41 PM
FIXED 2 DECIMAL PLACES, MUST ENTER ALL ZEROES AFTER DECIMAL POINT. =?Utf-8?B?U1VLWUtJVFRZ?= Microsoft Excel Misc 3 6th Jul 2005 01:50 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:30 PM.