Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default Decimal Places

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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 510
Default Decimal Places

Hi,

Just use instruction :

cur_interestPart1.NumberFormat = "#,##0.0000000000000000"

HTH
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default Decimal Places

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.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,440
Default Decimal Places

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 he

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

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

"David" wrote in message ...
| 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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Decimal Places Tafmutt Excel Discussion (Misc queries) 2 March 14th 07 09:22 PM
Subtracting two 2-decimal place numbers gives result 13-decimal places? [email protected] Excel Worksheet Functions 5 March 12th 07 10:38 PM
FIXED 2 DECIMAL PLACES, MUST ENTER ALL ZEROES AFTER DECIMAL POINT. SUKYKITTY Excel Discussion (Misc queries) 3 July 6th 05 01:50 PM
add 2 decimal places Bill M. Excel Discussion (Misc queries) 2 January 28th 05 10:21 PM
VBA decimal places Alex Excel Programming 2 January 10th 05 05:12 PM


All times are GMT +1. The time now is 04:34 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"