从txt获取数字并使用php对它们进行排序

时间:2015-07-01 09:41:38

标签: php jquery html css

我有一个txt文件,每晚都会使用新的数字进行更新,这些数字用于显示在html和css中。

txt文件结构是这样的一行:

  

256 9.16

数字256表示人数,并将用于这样的html句子中:

<p>256 people have ... </p>

9.16是给出的平均分数,应显示在用css制成的气压计中,其中css中的高度%控制长度。像这样:

<div class="amount" style="height: 91.6%;"></div>

正如您所看到的,数字9.16需要转换为91.6%并放入我的内联css中。

如果有人能帮助我,我会很高兴。 非常感谢你。

1 个答案:

答案 0 :(得分:1)

可能是最简单的方法:

- (BOOL)shouldAutorotate
{
    return NO;
}

- (NSUInteger)supportedInterfaceOrientations
{
   return UIInterfaceOrientationMaskPortrait;
}

- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
{
     return UIInterfaceOrientationPortrait;
}
相关问题