Trying to remove decimal from UISlider and text label

Dev123Dev

I have a uislider connected to a label, when the slider moves, the label adjusts its value. I am able to set the increments and the max and min, but i can't figure out how to remove the decimal places from the value..i simply want whole steps. suggestions please

- (IBAction)sliderValueChanged:(id)sender {

self.myLabel.text = [NSString stringWithFormat:@"%f", (roundf(self.mySlider.value)];
}
NobodyNada

Display the result as an int instead of a float.

self.myLabel.text = [NSString stringWithFormat:@"%d", (int)roundf(self.mySlider.value)];

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related