Decimal to fraction conversion


Closed Thread
Results 1 to 21 of 21

Hybrid View

  1. #1
    Join Date
    Dec 2006
    Posts
    38

    Default Decimal to fraction conversion

    I am looking for a way to convert a decimal number to a fraction I have looked thru the manual but cant seem to find a solution.

    What I need to do is convert say .0625 to 1/16

    I would like a resoultion of 1/16 of an inch.

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by tico View Post
    I am looking for a way to convert a decimal number to a fraction I have looked thru the manual but cant seem to find a solution.

    What I need to do is convert say .0625 to 1/16

    I would like a resoultion of 1/16 of an inch.
    Well,
    .0625 * 10000 = 625
    625 / 625 = 1
    1/16

    .1250 * 10000 = 1250
    1250 / 625 = 2
    2/16

    and so on and so on...

  3. #3
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    (results * 16)/1000 ???

    But we don't see and know what you're currently using... hard to guess
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  4. #4
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mister_e View Post
    (results * 16)/1000 ???
    I'm waiting for the question 'how do I get a decimal point or a slash in the fraction' or something like that.

  5. #5
    Join Date
    Dec 2006
    Posts
    38


    Did you find this post helpful? Yes | No

    Talking

    Thanks for the reply mister_e
    I have not written anything yet I am just begining this code for some reson I thought there might be some function built in.
    Its okay I guess I will just have to do it the straight math way.
    Last edited by tico; - 26th April 2007 at 01:52.

  6. #6
    Join Date
    Dec 2006
    Posts
    38


    Did you find this post helpful? Yes | No

    Default What happened skimask

    Hey skimask
    WOW 3 minutes went by and you realized you didnt say anything cocky, or did you just have to think for a while due to the fact you couldnt tell me to refer to the little green book at section x.yy

    and as for your cocky comment you can continue to wait for the other shoe to drop.

    but just so you dont have something else cocky to come back with I guess this will work...............

    LCDOUT $fe, 1, #Product,"/",#Remainder

Similar Threads

  1. A/D conversion with PIC18F67J50
    By ScaleRobotics in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 8th May 2009, 01:48
  2. Help for decimal conversion
    By eva in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 15th March 2007, 18:20
  3. microns to decimal conversion
    By Rleonard in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 28th February 2007, 14:37
  4. Decimal to Binary Conversion
    By schlaray in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 23rd December 2006, 14:58
  5. Decimal to binary conversion
    By Demon in forum Code Examples
    Replies: 9
    Last Post: - 25th February 2005, 20:05

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

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