« first day    last day (40 days later) » 

6:51 AM
@iAnum : Good noon :)
i need to print 50.00 or 100.00 or 150.00
currently i am doing this but this still prints 50,100 or 100 as selected
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {


UITableViewCell *selectedCell = [tableView cellForRowAtIndexPath:indexPath];
NSString *encodeCategoryString = [NSString stringWithFormat:@"%2@", selectedCell.textLabel.text];

setMiles = [encodeCategoryString integerValue];
if (setMiles == 50) {
setMiles = 50.00;
}else if (setMiles == 100) {
setMiles = 100.00;
}else if (setMiles == 150) {
setMiles = 150.00;
}
NSLog(@"setMiles = %ld",(long)setMiles);
i know this is silly but i am not getting anything on google aswell
if you could please help @iAnum
 
7:29 AM
hello hru?
u need to the numbers to be float in order to print them in form of decimal
u should use miles as float
then use NSLog(@"setMiles = %.2f",setMiles);
@iCodeAtApple
or u can use double for large nums
 
8:10 AM
did u solve the issue? @iCodeAtApple
 
9:10 AM
@iAnum : I am good...thank you :)
What about you ?
yes initially it was not working...like it was printing 20.00000000 like this when i used float but using your code did the charm :)
Thank you @iAnum :)
can you please tell me that now it prints the value 20.00 because we have used %.2f but what if i want to use 20.00 as one of my parameter
 
10:11 AM
can u elaborate how u wanna use as param? mje smj nh aya
sorry i was out for lunch
@iCodeAtApple
 
No issues ... lunch this late ? :0

well i want to use it as parameter to my query ... if user selects 50 i need to pass 50.00 as the parameter. I have used table for displaying the options which are 50, 100, 150
@iAnum
so from the above i can directly use setMiles as the parameter but setMiles should be holding values like 50.00 or 100.00 depending on what user selects
 
hmm may be u should use nsnumberformatter
just an idea
mre khyal me
.00 he hoga precision hmesha?
to phr aram se typecast krskti ho jb use krna ho. pass 50, 100 etc he krdo
 
will that do...even i was wondering that .00 would not matter much nah
so shall i proceed with it ?
no worries nah ?
 
nops. dont think so
 
then i would be required to convert it ?
 
10:21 AM
whats the issue in conversion? I don't get it :\
jab use krna hoto float me krdo
else jesa chaho use kro na
 
i only want to use 50.00 as paramtere
we have used .2f for printing but for using as actual parameter will that work
 
then use float everywhere. precision will be maintained
pass float as param
n while printing use %.2f
issue solve
no need of typecst
 
while printing it is printing as we want and i am using float only as parameter
but i only want to know parameter will be passed as 50 or 50.00
 
to which func r u passing param?
i don't know what query u r passing to
 
the query i was discussing yesterday...
my problem which eventually got solved
remember it
 
10:41 AM
yup i rem. but mene parse n notifications pe kabhi kam he nh kia to mje func kese malum hngy :(
 
oh yeah..you informed me...
i know that...but il do one thing il check with it...
and let you know the status :)
 
okz
:)
 
 
2 hours later…
1:03 PM
@iAnum : That worked well :)
 
 
1 hour later…
2:06 PM
great (Y)
 

« first day    last day (40 days later) »