Shop OBEX P1 Docs P2 Docs Learn Events
remove decimal point — Parallax Forums

remove decimal point

basilbs2basilbs2 Posts: 9
edited 2006-06-18 22:43 in BASIC Stamp
Hi ,·how·can I remove the digits after the decimal point in my program such as: 32.58 I want it to use the 32 only and not read the rest so when I multiply it would only multiply the 32.

thanks, sorry to interrupt.

basil

Comments

  • SSteveSSteve Posts: 808
    edited 2006-06-18 22:12
    PBASIC only deals with integers. Where is the 32.58 coming from? How is it being stored?

    We need the bigger picture.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    OS-X: because making Unix user-friendly was easier than debugging Windows

    links:
    My band's website
    Our album on the iTunes Music Store
  • basilbs2basilbs2 Posts: 9
    edited 2006-06-18 22:23
    THE 32.58 came from dividing another number by 20 then 60, hence the decimal numbers. sometimes the number is 32.5864 when I multiply that # by 69 I get a different # than 32 or 32.58

    is this making sense?

    thanks
  • Mike GreenMike Green Posts: 23,101
    edited 2006-06-18 22:43
    This is not making sense. Are you doing the division using the Stamp? If so, when you divide by 20, you're already getting just an integer quotient. When you divide that by 60, again you're getting an integer result. Perhaps you should show us the portion of your program involved.
Sign In or Register to comment.