How do you remove the decimal from an integer so that it may be used with the timeCnv( command?
http://tibasicdev.wikidot.com/ipart
[MATH] NUM 3:iPart(
I believe he means this for 68k programming, and the problem is that after a calculation like 5.5+5.5 the calculator spits out a 11. instead of regular 11 without the decimal point. I know the Nspire will do this, but I myself don't know how to fix it.
Timothy Foster - @tfAuroratide
Auroratide.com - Go here if you're nerdy like me
—Déjà vu. I think I already answered this for Timothy Foster on the n-spire section of this forum.
▶approxfrac()
It works every time i guarantee it. Your dealing with a type casting problem. the "." indicates that the calculator is using a floating point representation in the background ▶arproxfrac() forces the type conversion problem solved.—
I retract this as I realise that ▶arproxfrac() is missing from the 86k command set. its in the 84 basic and its in n-spire basic so I assumed it was in 86k basic. Apparently i was wrong but I found a command that does work exact() but this only works on calculator with a CAS. although my program in the response to Timothy Foster's post works regardless. (I cloned it here for your convenience.)
Define rmvpnt(x)=Func
:local t
:string(x)→t
:inString(x,".")→t
:expr(ifFn(t=0,x,left(x,t-1)))
:EndFunc
see original post for details
Thanks for all you help. I actually figured out another way. I think it has to do with the Exact or Approx setting. I was using the round( command because timeCnv( requires an integer greater than zero (since it has to be in seconds) and apparently it has to be considered an exact answer. I was calculating time using a decimal value, so I used round(expr,0) to get my answer but it would return an answer as if in the Approximate mode. To fix I used the command:
:timeCnv(exact(round(tmr+ete[1]*60,0)))
This rounds the answer and then changes it to exact mode without having to change the calculator mode which would slow down some of my custom functions.
This is the best way I can figure to do it. I'm new to this, so if anyone has a suggestion that would work faster I'm open for suggestions.
Thanks
that only works on calculators with a built in CAS on everything else it errors