1. ## 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\$",`

Thank you

2. 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

3. 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.

4. I guess no one know... or will tell me. Still hoping someone can help

5. 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. For some reason it didnt work. Ill try again though.

7. 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.

8. 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.

Thanks.

#### Posting Permissions

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