美文网首页
处理label显示的数字

处理label显示的数字

作者: 越天高 | 来源:发表于2021-09-29 15:13 被阅读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];
   

相关文章

网友评论

      本文标题:处理label显示的数字

      本文链接:https://www.haomeiwen.com/subject/jxhsnctx.html