# Simple Formula causes error on my watch

I am testing a simple formula which works fine on WFS 1.5.7 but not on my GW4 Classic.
Simply makes a usage percent after midnight when charge is finished .
I realise that dived by Zero will give an error but the error is present when both numbers are above Zero .
Any Help would be appreciated .
.
.
`((100-([BATT_PER]))/([HOUR_1_24_MIN])) %ph`
.
.
.
`((100-([BATT_PER]))/([HOUR_0_23_MIN])) %ph`
.
.
. .
.
. Hi, i supect its too result is two many decimal place beyond what the watch caculated can compute.

Try this [HOUR_1_24] , wont be to the min caculatation but will test my Hypothesis.

1 Like

Hey Thanks I will look at that . I thought [HOUR_1_24_MIN] was two decimal . Surly that would not make an unmanageable number .

Hi @russellcresser ,its after the division. The result is to many decimal place. Your example is 23/8.338 = 2.6038718442

Where as the other one is exactly 2.25

1 Like

Hey Cool . Thanks for staying with this .
I could not get numberFormat() to work

So I am trying this .

`((floor(((100-([BATT_PER]))/([HOUR_1_24_MIN]))*100))/100)`

1 Like

@russellcresser , I also trying to figure out what numberformat is about. Thought for u should be using , numberformat(000.000, formula)

1 Like

This works but I not with my formula in it .
.
`(numberFormat("#.##",([SEC_MSEC])))`

Hi, anyway your multiple by 100 then floor then divide back should work.

Your formula should get u 2.60

1 Like

Yeah I am trying that .
This does not work .
.
`(numberFormat("#.##",(((100-([BATT_PER]))/([HOUR_1_24_MIN]))))) %ph`

@russellcresser
Hi would just use the floor method.
Easier to implement and understand

1 Like

Back to Basics .
Some times it is the old Grunt formulas that work.
Sadly this one does not either .
So between Facer and WFS I always seem to come up against Issues . I was thinking of having a look at Harmony Next or maybe WatchMaker . An Opinion on that would be welcomed .
Thanks very much for your input . I think the possibilities are exhausted here .
.
.
`((floor(((100-([BATT_PER]))/([HOUR_1_24_MIN]))*100))/100) %ph`

When situation like this occurs, i do some troubleshooting.

E.g Forgo _min tag or hard code number first e.g

If 23/8.338 works. Then its the tag has issues. Else its the formula.

1 Like

Hey . Listen @Knightwing . Sorry I lost my temper there.
Yes Basic testing is the way forward .
I got it working now and the exercise of getting Format and Floor to work is all good exercise .
the %ph I had at the end of the line was causing the problem .
Because I had use things like
`left [BATT_PER] %`
Earlier I thought it would be ok .
I always thought () contained you formula and anything outside was considered text . over at Facer they use \$ \$ as a place holder for formulas . I need some new Habits .
Thanks so much .
Next to RON you seem to be one of the Regular respondents .

@russellcresser
HI, its ok,

I just a member like you, some how I just enjoying helping others. and doing testing.
on something that interest me.

anyway what worked for me after testing your formula is instead of %ph , I used % ph
(space in between % and Ph)

1 Like

Ha Ha . That simple . I just split them up . I often do that any way so they don’t jiggle to much when a number is changing . Not so bad on a number like that but if you have seconds Jiggling the whole time it look silly to me .
I have helped a bit on Facer but after a while one can grow out of that .