當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CommonFunctions::formatSiUnitPrefix方法代碼示例

本文整理匯總了PHP中CommonFunctions::formatSiUnitPrefix方法的典型用法代碼示例。如果您正苦於以下問題:PHP CommonFunctions::formatSiUnitPrefix方法的具體用法?PHP CommonFunctions::formatSiUnitPrefix怎麽用?PHP CommonFunctions::formatSiUnitPrefix使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CommonFunctions的用法示例。


在下文中一共展示了CommonFunctions::formatSiUnitPrefix方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: add_si_unit

function add_si_unit($number)
{
    return CommonFunctions::formatSiUnitPrefix($number);
}
開發者ID:THM068,項目名稱:orangehrm,代碼行數:4,代碼來源:OrangeHelper.php

示例2: testFormatSiUnitPrefix

 /**
  * Test method for formatSiUnitPrefix()
  */
 public function testFormatSiUnitPrefix()
 {
     // No Unit prefix
     $this->assertEquals("100", CommonFunctions::formatSiUnitPrefix(100), CommonFunctions::formatSiUnitPrefix(100));
     $this->assertEquals(152, CommonFunctions::formatSiUnitPrefix(152));
     $this->assertEquals(94, CommonFunctions::formatSiUnitPrefix(94));
     // kilo
     $this->assertEquals("1 k", CommonFunctions::formatSiUnitPrefix(1000));
     $this->assertEquals("1.52 k", CommonFunctions::formatSiUnitPrefix(1520));
     $this->assertEquals("1.52 k", CommonFunctions::formatSiUnitPrefix(1523));
     // Mega
     $this->assertEquals("1 M", CommonFunctions::formatSiUnitPrefix(1000000));
     $this->assertEquals("1.53 M", CommonFunctions::formatSiUnitPrefix(1530000));
     $this->assertEquals("1.53 M", CommonFunctions::formatSiUnitPrefix(1525000));
     $this->assertEquals("1.54 M", CommonFunctions::formatSiUnitPrefix(1536750));
     // Giga
     $this->assertEquals("1 G", CommonFunctions::formatSiUnitPrefix(1000000000));
     $this->assertEquals("1.93 G", CommonFunctions::formatSiUnitPrefix(1930000000));
     $this->assertEquals("1.54 G", CommonFunctions::formatSiUnitPrefix(1542000000));
     $this->assertEquals("1.55 G", CommonFunctions::formatSiUnitPrefix(1546000000));
     //Tera
     $this->assertEquals("1 T", CommonFunctions::formatSiUnitPrefix(1000000000000));
     $this->assertEquals("1.45 T", CommonFunctions::formatSiUnitPrefix(1450000000000));
     $this->assertEquals("1.52 T", CommonFunctions::formatSiUnitPrefix(1523000000000));
     $this->assertEquals("1.53 T", CommonFunctions::formatSiUnitPrefix(1525000000000));
 }
開發者ID:noikiy,項目名稱:owaspbwa,代碼行數:29,代碼來源:CommonFunctionsTest.php

示例3:

            <td><a href="#" title="<?php 
            echo $rset[$c][2];
            ?>
" onmousedown="viewAttach('<?php 
            echo $rset[$c][1];
            ?>
')" ><?php 
            echo $rset[$c][3];
            ?>
</a></td>
            <td><?php 
            echo $rset[$c][2];
            ?>
</td>
            <td><?php 
            echo CommonFunctions::formatSiUnitPrefix($rset[$c][4]);
            ?>
B</td>
            <td><?php 
            echo $rset[$c][6];
            ?>
</td>
        </tr>
<?php 
        }
        ?>
			</tbody>
          </table>
<?php 
    } else {
        if (!$locRights['add']) {
開發者ID:googlecode-mirror,項目名稱:pucit-orangehrm,代碼行數:31,代碼來源:hrempattachment.php


注:本文中的CommonFunctions::formatSiUnitPrefix方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。