Merge pull request #5250 from jitendrapurohit/CRM-15934update
[civicrm-core.git] / CRM / Utils / Number.php
index b79b994caccad4305ca05dfa7445ae9eb9fb0f64..ff9c4d66d0b30bc7a6e29163316aa507162df5d8 100644 (file)
@@ -5,14 +5,15 @@
  */
 class CRM_Utils_Number {
   /**
-   * Create a random number with a given precision
+   * Create a random number with a given precision.
    *
-   * @param array $precision (int $significantDigits, int $postDecimalDigits)
+   * @param array $precision
+   *   (int $significantDigits, int $postDecimalDigits).
    *
    * @return float
    * @link https://dev.mysql.com/doc/refman/5.1/en/fixed-point-types.html
    */
-  static function createRandomDecimal($precision) {
+  public static function createRandomDecimal($precision) {
     list ($sigFigs, $decFigs) = $precision;
     $rand = rand(0, pow(10, $sigFigs) - 1);
     return $rand / pow(10, $decFigs);
@@ -24,11 +25,12 @@ class CRM_Utils_Number {
    * and/or move the decimal place.
    *
    * @param int|float $keyValue
-   * @param array $precision (int $significantDigits, int $postDecimalDigits)
+   * @param array $precision
+   *   (int $significantDigits, int $postDecimalDigits).
    * @return float
    * @link https://dev.mysql.com/doc/refman/5.1/en/fixed-point-types.html
    */
-  static function createTruncatedDecimal($keyValue, $precision) {
+  public static function createTruncatedDecimal($keyValue, $precision) {
     list ($sigFigs, $decFigs) = $precision;
     $sign = ($keyValue < 0) ? '-1' : 1;
     $val = str_replace('.', '', abs($keyValue)); // ex: -123.456 ==> 123456
@@ -43,4 +45,5 @@ class CRM_Utils_Number {
       return $sign * $val;
     }
   }
+
 }