Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Access Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Extract Whole Number From Decimal
Mitchell Ellis 
    
4 days ago
How do I Extract Whole Number From Decimal?  I'm taking measurements with a laser that uses whole number and decimals - 25.25' I need to change the measurement in 1 field to feet in 1 field and inches in another field.  So I need to take the 25.25 and break it into 25 and 3.  The reason is that I measure attachements on Power poles to make room for a new attacher like a Fiber cable and sometimes things have to move either up or down and inches is the measurements used.  its better to say Raise 3" rather than Raise .25'
Mitchell Ellis OP  @Reply  
    
4 days ago

Mitchell Ellis OP  @Reply  
    
4 days ago
Youtube hyperlink of explaination  https://youtu.be/SYj3gw1hPoU
Kevin Robertson  @Reply  
          
4 days ago
Why are you adding 2.75" onto the fractional component?
Kevin Robertson  @Reply  
          
4 days ago
Did you mean 0.3 for the fractional component?

    Dim d As Double, wholeNum As Long, fracNum As Double
    
    d = 25.25
    
    wholeNum = Int(d)
    fracNum = d - wholeNum
    fracNum = -Int(-(fracNum * 10)) / 10

    MsgBox wholeNum    '25
    MsgBox fracNum     '0.3
Gary Becker  @Reply  
     
4 days ago
I think he means 3" (inches) for the .25 fractional part of a 12" foot. So you could take the the fractional part (i.e. .25) times 12 to get the number of inches.
Mitchell Ellis OP  @Reply  
    
3 days ago
Yes it's in US feet and inches.
Mitchell Ellis OP  @Reply  
    
3 days ago
And I know how to take decimals of a foot and convert it to inches, that's the easy part.
Kevin Robertson  @Reply  
          
3 days ago
What part are you having trouble with?
Mitchell Ellis OP  @Reply  
    
3 days ago
I'm trying to decide how to the feet and decimal to come up with feet and inches. these will go in separate fields... I think.  
See this youtube video - https://youtu.be/SYj3gw1hPoU  for a more detailed explanation of what I'm trying to do.

I don't necesarrily think the info has to be saved into the database it could just show up on a form like the youtube video shows on the excel spreadsheets
Matt Hall  @Reply  
          
3 days ago
Depending on how you are using the info, you might be able to multiply by 12 and work in only inches.  You can always convert back to feet-inches for display if needed.
Kevin Robertson  @Reply  
          
3 days ago
Is this anywhere close?

    Dim d1 As Double, d2 As Double
    Dim wholeNum As Long, fracNum As Double

    d1 = 25.25

    wholeNum = Int(d1)
    fracNum = -Int(-((d1 - wholeNum) * 10))
    d2 = wholeNum + (fracNum / 10)

    MsgBox wholeNum    '25
    MsgBox fracNum     '3
    MsgBox d2          '25.3
Kevin Robertson  @Reply  
          
3 days ago
Or to display in feet and inches you could use one of these.

    S1 = wholeNum & "'" & fracNum & """"        '25'3"
    S2 = wholeNum & "ft " & fracNum & "ins"     '25ft 3ins
Mitchell Ellis OP  @Reply  
    
2 days ago
Thanks a bunch!!!!
Add a Reply Upload an Image
Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 7/5/2026 8:47:34 PM. PLT: 1s