[NSTimer scheduledTimerWithTimeInterval:0.01 target:self selector:@selector(timerFireMethod:) userInfo:nil repeats:YES];
- (void)timerFireMethod:(NSTimer *)theTimerP{
//根据数值大小判断平均增加值
float aver;
if (amountF > 1000){
aver = 100;
} else if (amountF > 100){
aver = 10;
} else if (amountF > 10){
aver = 1;
} else{
aver = 0.1;
}
//增加平均值
indexF += amountF/aver;
//判断是否达到随机数值
if (indexF < amountF) {
//判断随机数是否小于10
if (amountF<=10) {
//小于等于10,增加时显示小数点后两位
amountLabel.text = [NSString stringWithFormat:@"%.2f",indexF];
}else{
//否则,增加时不显示小数位