LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions
Spaz
 
Posts: n/a
Default How many decimal places can a cell display?

How many decimal places can be displayed in a cell? I'm running a brute
force VBA procedure of finding fractions that will approximate pi to as many
decimal places as Excel will display, but I don't know how many decimal
places Excel will display accurately. Anybody know? I guess this is also a
matter of how many decimal places VBA will calculate accurately as well.

Sub PiFractions()
Dim dividend As Integer, divisor As Integer, quotient As Double
Dim rowpointer As Byte

rowpointer = 1

For dividend = 22 To 10000
For divisor = 7 To dividend \ 3
quotient = dividend / divisor
If quotient 3.14159 And quotient < 3.1416 Then
Cells(rowpointer, 1) = dividend
Cells(rowpointer, 2) = divisor
Cells(rowpointer, 3) = quotient
rowpointer = rowpointer + 1
End If
Next
Next

End Sub


 
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
Setting the number of decimal places for a text box. Aaron1978 Excel Discussion (Misc queries) 3 March 8th 06 04:59 PM
Urgent date/scheduling calc needed jct Excel Worksheet Functions 3 February 24th 06 01:36 AM
large text amount in cell will not display in the cell dbelch01 Excel Discussion (Misc queries) 3 June 15th 05 03:43 PM
Need Workaround for Cell Display Limitation in Excel 2000 Kevin Excel Discussion (Misc queries) 5 April 20th 05 11:33 PM
Changing display of decimal value based on the value in the cell K M Excel Worksheet Functions 3 April 3rd 05 06:49 PM


All times are GMT +1. The time now is 02:40 AM.

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"