Results 1 to 8 of 8

Thread: Dividing variables

  1. #1
    Low Bitrate frangolfgt's Avatar
    Join Date
    Jul 2006
    Location
    Lancs, UK
    Posts
    91

    Dividing variables

    How do i divide variables in RR? / sign is taken, so what symbol do you use? I am making a fuel log (just a table)

    date litres p per litre milage cost mpg

    variables are called

    datef namef pencef lastf nextf interf

    Date, litres, p per litre, milage are filled in with the numosk, cost is worked out by multiplying litres by p per litre - this works fine

    Code:
    B,549,115,105,28,"BYVAR;VMPAGE;EVAL;VMNEXTF01;$VMNAMEF01$*$VMPENCEF01$<<EVAL;VMNEXTF01B;$VMNAMEF01B$*$VMPENCEF01B$",
    I want to get mpg by dividing milage by litres and then dividing this by 4.5. If it was a / sign for divide it would be this (unless i made a mistake).

    Code:
    B,655,115,74,28,"BYVAR;VMPAGE;EVAL;VMINTERF01;$VMLASTF01$/$VMNAMEF01$/$4.5$<<EVAL;VMINTERF01B;$VMLASTF01B$/$VMPENCEF01B$/$4.5$",
    Please help if you can.

    Thank you
    Skins:
    /showthread.php?t=83814 (R.I.P.)
    /104373-golf-skin.html (R.I.P.)
    /106214-metal-spin-release.html(RIP)
    using own vw gypsy clone
    On 2nd PC: 1st one died.

  2. #2
    The Curator
    Auto Apps:loading...
    Blue ZX3's Avatar
    Join Date
    Aug 2004
    Location
    Chicago area,IL
    Posts
    5,079
    To make this much easier, Y don't you just use the Milage trip plugin??

    This is what it does, and keeps a log, like the one your trying to do *re-inventing the wheel??

    See here, I use it and it works great.

    http://www.mp3car.com/vbulletin/rr-p...nsumption.html
    RideRunner...The #1 FE, PERIOD.

    Current Project: DFXVoice [v1.0 Released]
    Next in line: RRMedia v2.0

    DFX 5.1.1 Skin
    Appstore Link

    My RideRunner Plugins
    RRMedia
    RRExtended
    DFXVoice

    "There are no bugs - only undocumented features."

  3. #3
    Low Bitrate frangolfgt's Avatar
    Join Date
    Jul 2006
    Location
    Lancs, UK
    Posts
    91
    I know about that but cant test it it needs gps. I thought it would be simple to do it my way, I just need the divide symbol. Plus ive made the skin and it took ages.
    Skins:
    /showthread.php?t=83814 (R.I.P.)
    /104373-golf-skin.html (R.I.P.)
    /106214-metal-spin-release.html(RIP)
    using own vw gypsy clone
    On 2nd PC: 1st one died.

  4. #4
    Low Bitrate frangolfgt's Avatar
    Join Date
    Jul 2006
    Location
    Lancs, UK
    Posts
    91
    I guess no one know... or will tell me. Still hoping someone can help
    Skins:
    /showthread.php?t=83814 (R.I.P.)
    /104373-golf-skin.html (R.I.P.)
    /106214-metal-spin-release.html(RIP)
    using own vw gypsy clone
    On 2nd PC: 1st one died.

  5. #5
    FLAC Sal R.'s Avatar
    Join Date
    Aug 2006
    Location
    Sun Diego
    Posts
    1,448
    Why can't you use "/" ? I did and it works fine.

    Here's a line I use it in:
    Code:
    "EVALWINAMPVOL","EVAL;evalwinampvolvar;$TEMPigwinampvol$*255/100||SETVAR;evalwinampvolvar;$evalwinampvolvar$||SAVETOSKIN;evalwinampvolvar;$evalwinampvolvar$"

  6. #6
    Low Bitrate frangolfgt's Avatar
    Join Date
    Jul 2006
    Location
    Lancs, UK
    Posts
    91
    For some reason it didnt work. Ill try again though.
    Skins:
    /showthread.php?t=83814 (R.I.P.)
    /104373-golf-skin.html (R.I.P.)
    /106214-metal-spin-release.html(RIP)
    using own vw gypsy clone
    On 2nd PC: 1st one died.

  7. #7
    Low Bitrate frangolfgt's Avatar
    Join Date
    Jul 2006
    Location
    Lancs, UK
    Posts
    91
    Ok found the problem... It now works. Thought the problem was because it couldnt use / as divide but it was something else entirely - some variables were named and labeled wrong and my maths was dodgy. LOL. Thanks for making me check again. If anyone wants the code, what it does and what i did with it just ask.
    Skins:
    /showthread.php?t=83814 (R.I.P.)
    /104373-golf-skin.html (R.I.P.)
    /106214-metal-spin-release.html(RIP)
    using own vw gypsy clone
    On 2nd PC: 1st one died.

  8. #8
    Low Bitrate frangolfgt's Avatar
    Join Date
    Jul 2006
    Location
    Lancs, UK
    Posts
    91
    Ok another question - is it possible to limit numbers to 2 dp only? I only need 2 decimal places in my output numbers, any more is pointless.

    One gives a cash value for cost, (so obviously more than 2dp gives 10ths of pence - useless)
    T
    he other gives MPG which only needs 1dp really (it isnt accurate enough to use any more) plus who cares about being something like 0.05 of a MPG out.

    Please help if you can.

    Thanks.
    Skins:
    /showthread.php?t=83814 (R.I.P.)
    /104373-golf-skin.html (R.I.P.)
    /106214-metal-spin-release.html(RIP)
    using own vw gypsy clone
    On 2nd PC: 1st one died.

Similar Threads

  1. Replies: 10
    Last Post: 02-06-2007, 04:46 PM
  2. Some clarity on variables being sent to flash objects...
    By Sonicxtacy02 in forum Road Runner
    Replies: 7
    Last Post: 10-17-2006, 12:44 PM
  3. indicators with variables feature.. whats it about?
    By Sonicxtacy02 in forum Road Runner
    Replies: 11
    Last Post: 09-06-2006, 10:28 AM
  4. How do I use Variables on my Skin ?
    By guino in forum RR FAQ
    Replies: 0
    Last Post: 06-07-2006, 10:51 AM
  5. PHP...not reading url variables...
    By PoBoy in forum Off Topic
    Replies: 10
    Last Post: 09-16-2002, 09:53 PM

Bookmarks

Posting Permissions

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