处理label显示的数字

2021-09-29  本文已影响0人  越天高
//设置播放数
    if (topic.playcount > 10000)
    {
        self.playCountLabel.text = [NSString stringWithFormat:@"%.1f播放", topic.playcount/ 10000.0];
    }
    else
    {
      self.playCountLabel.text = [NSString stringWithFormat:@"%ld播放", topic.playcount];
    }
    
    
    //播放时间 设置为显示位数,如果不够,前面补0
    
    self.playTimeLabel.text = [NSString stringWithFormat:@"%02ld:%02ld", topic.voicetime / 60, topic.voicetime % 60];
   
上一篇 下一篇

猜你喜欢

热点阅读