how to calculate an every process separately and display them at together
at running time?
b.putFloat("My Odometer", (float)
(gpsdataElements.Distance-Contsants.jobStartKm));
if(gpsdataElements.Speed<1)
{
Contsants.cont_WaitingTimeInSec++;
}
float totalKm = Contsants.jobEndKm-Contsants.jobStartKm ;
if (totalKm<Contsants.minDist)
{
float totalfare=Contsants.minFare;
b.putString("Fare", String.format("%.2f",(totalfare)));
}
else
{
float totalfare= Contsants.minFare+
((totalKm-Contsants.minDist) *Contsants.rupeeKm)
+(Contsants.cont_WaitingTimeInSec/60)*1;
b.putString("Fare", String.format("%.2f",(totalfare)));
}
here is my code for calculating total fare. problem in else part
condition. During running time it will not display the calculation
properly. It was hangs up and shows force close error. any other way to
calculate this (Contsants.minFare+ ((totalKm-Contsants.minDist)
*Contsants.rupeeKm) +(Contsants.cont_WaitingTimeInSec/60)*1) three
parameters separately and display them together at running time. Because i
am going to use this code for taxi booking application. i want to display
the current fare in the display at running time.
No comments:
Post a Comment