Overview

Classes

  • Api1
  • Array1
  • ArrayObject1
  • Auth1
  • AuthModel1
  • Chat1
  • Class1
  • Color1
  • Console1
  • Controller1
  • Converter1
  • Cookie1
  • Date1
  • DateManager1
  • Db1
  • DbPref1
  • EasyBook
  • EasyCountry
  • EasyGenerator
  • EasyProduct
  • EasyProject
  • EasySchool
  • EasyStatus
  • exApiController1
  • exBlade1
  • exClass
  • exData1
  • exMail1
  • exRoute1
  • exTranslate1
  • exUrl1
  • FileManager1
  • FilePref1
  • Form1
  • Function1
  • Header1
  • Html1
  • HtmlAsset1
  • HtmlForm1
  • HtmlStyle1
  • HtmlWidget1
  • Math1
  • Model1
  • Model1FileLocator
  • Number1
  • Object1
  • Page1
  • Picture1
  • Popup1
  • QUESTION_TYPE
  • RecursiveArrayObject1
  • RegEx1
  • ResultObject1
  • ResultStatus1
  • ServerRequest1
  • Session1
  • SessionPreferenceSave1
  • String1
  • TaskManager1
  • Url1
  • Validation1
  • Value1

Interfaces

  • Controller1RouteInterface
  • Model1ActionInterface
  • Model1PageInterface

Functions

  • __
  • api_and_form_default_route
  • app
  • app_api_list
  • app_class_list
  • app_class_paths
  • app_class_with_interface
  • app_controller_list
  • app_dashboard_list
  • app_db_model_list
  • app_db_table_list
  • app_model_list
  • app_page_list
  • asset
  • csrf_token
  • current_layout_asset
  • current_plugin_asset
  • current_resources_asset_path
  • d
  • dd
  • file_base
  • file_session
  • file_session_get
  • file_session_remove
  • file_session_save
  • form_call_api
  • form_call_controller
  • form_token
  • get_all_view_in_directory
  • get_valid_view_path
  • is_token_valid
  • is_ajax_request
  • layout_asset
  • mailer
  • mailer_send_mail_to_list
  • make_default_route
  • makeRoute
  • normalizeSharedPath
  • now
  • now_date
  • now_time
  • old
  • paginate
  • path_app
  • path_asset
  • path_asset_url
  • path_clear_cache
  • path_main
  • path_main_url
  • path_shared
  • path_shared_app
  • path_shared_asset
  • path_shared_asset_url
  • path_shared_resources
  • path_to_viewpath
  • plugin_asset
  • pre
  • redirect
  • redirect_back
  • redirect_failed
  • redirect_to_view
  • register_path_for_layout_asset
  • request
  • resources_path
  • resources_path_asset
  • resources_path_cache
  • resources_path_plugin
  • resources_path_view
  • resources_path_view_cache
  • resources_path_view_layout
  • route
  • routes
  • shared_asset
  • token
  • translate_language
  • translated_language
  • url
  • view
  • view_exists
  • view_make
  • viewpath_to_path
  • Overview
  • Class

Class Number1

Direct known subclasses

Math1
Located at easycore/Ehex.php
Methods summary
public static
# isNumber( $value )

using date help

using date help

public static
# getUniqueId( )
public static
# sortNumbers( $list = [], $sort_flag = null )
public static
# getRandomNumber( $randomizeTime = 2 )
public static
# getDateId( )
public static
# toSIzeUnit( $sizeValue )
public static
# formatMoney( $number, $fractional = false )
public static
# toMoney( $val, $symbol = '$', $r = 2 )
public static integer
# getPercentageBofA( $valueB, $valueA_orTotalValue, integer $percentageIs = 100 )

Parameters

$valueB
$valueA_orTotalValue
$percentageIs

Returns

integer
(return only percentage B of As. e.g percetage 5 of 40 = 12.5%)
public static integer
# getPercentageValue( $value, integer $percentage = 10, integer $noNegativeNumber = true, boolean $percentageIs = 100 )

Parameters

$value
$percentage
$noNegativeNumber
$percentageIs
$percentageIs
$noNegativeNumber

Returns

integer
(return only percentage of the value passed in)
public static array
# getValueMinMaxByPercentage( $value, integer $percentage = 10, boolean $noNegativeNumber = true )

Parameters

$value
$percentage
$noNegativeNumber

Returns

array
( array that consist of min, max, percentage or discount, maxFake, and value keys)
public static float
# getAveragePercentage( array $percentageList )

Parameters

$percentageList
$percentageList

Returns

float

(use when you av more than one percentage to deal with);

e.g (find average percentage of 60%,40%. just convert the two number to decimal by dividing them with 100, so u get 0.6 & 0.4, then add the two numbers then divide the result by 2 i.e 0.5, finally multiply he result with 100)

public static
# getAveragePercentage2( $percentageList )
public static boolean
# isInRange( $value, $min, $max )

Parameters

$value
must exists between $min and $max)
$min
$max

Returns

boolean
public static
# filterNumber_regex( $numberString )
public static
# filterNumber( $numberString )
public static
# toNumber( $numberString )
public static
# encodeToShortAlphaNum( $n, $codeSet = "23456789abcdefghijkmnopqrstuvwxyzABCDEFGHIJKLMNPQRSTUVWXYZ" )
public static
# decodeFromShortAlphaNum( $code, $codeSet = "23456789abcdefghijkmnopqrstuvwxyzABCDEFGHIJKLMNPQRSTUVWXYZ" )
public static string
# toWord( $number, boolean $strictlyNumber = true )

Parameters

$number
$strictlyNumber

Returns

string

If you want to convert an integer into an English word string, eg. 29 -> twenty-nine, then here's a function to do it Note on use of fmod()   I used the floating point fmod() in preference to the % operator, because % converts the operands to int, corrupting values outside of the range [-2147483648, 2147483647] I haven't bothered with "billion" because the word means 10e9 or 10e12 depending who you ask. The function returns '#' if the argument does not represent a whole number.

public static boolean
# isEven( $number )

Is integer even number

Is integer even number

Parameters

$number

Returns

boolean
public static boolean
# isPrime( $number )

Checks if the provided integer is a prime number. isPrime(3); // true

Checks if the provided integer is a prime number. isPrime(3); // true

Parameters

$number

Returns

boolean
public static boolean
# isApproximatelyEqual( $number1, $number2, float $epsilon = 0.001 )

Checks if two numbers are approximately equal to each other. Use abs() to compare the absolute difference of the two values to epsilon. Omit the third parameter, epsilon, to use a default value of 0.001. approximatelyEqual(10.0, 10.00001); // true approximatelyEqual(10.0, 10.01); // false

Checks if two numbers are approximately equal to each other. Use abs() to compare the absolute difference of the two values to epsilon. Omit the third parameter, epsilon, to use a default value of 0.001. approximatelyEqual(10.0, 10.00001); // true approximatelyEqual(10.0, 10.01); // false

Parameters

$number1
$number2
$epsilon

Returns

boolean
public static integer
# getMinNumber( array $numbers )

Returns the n minimum elements from the provided array.

Returns the n minimum elements from the provided array.

Parameters

$numbers

Returns

integer
public static integer
# getMaxNumber( array $numbers )

Returns the n maximum elements from the provided array.

Returns the n maximum elements from the provided array.

Parameters

$numbers

Returns

integer
public static float|integer|mixed
# getMedian( array $numbers )

Returns the median of an array of numbers. median([1, 3, 3, 6, 7, 8, 9]); // 6 median([1, 2, 3, 6, 7, 9]); // 4.5

Returns the median of an array of numbers. median([1, 3, 3, 6, 7, 8, 9]); // 6 median([1, 2, 3, 6, 7, 9]); // 4.5

Parameters

$numbers

Returns

float|integer|mixed
public static float|integer|mixed
# getLCM( mixed $numbers )

Returns the least common multiple of two or more numbers. lcm(12, 7); // 84 lcm(1, 3, 4, 5); // 60

Returns the least common multiple of two or more numbers. lcm(12, 7); // 84 lcm(1, 3, 4, 5); // 60

Parameters

$numbers
$numbers

Returns

float|integer|mixed
public static float|integer|mixed
# getGCD( mixed $numbers )

Calculates the greatest common divisor between two or more numbers. gcd(8, 36); // 4 gcd(12, 8, 32); // 4

Calculates the greatest common divisor between two or more numbers. gcd(8, 36); // 4 gcd(12, 8, 32); // 4

Parameters

$numbers
$numbers

Returns

float|integer|mixed
public static array
# fibonacci( $n )

Generates an array, containing the Fibonacci sequence, up until the nth term. fibonacci(6); // [0, 1, 1, 2, 3, 5]

Generates an array, containing the Fibonacci sequence, up until the nth term. fibonacci(6); // [0, 1, 1, 2, 3, 5]

Parameters

$n

Returns

array
public static float|integer
# factorial( $n )

Calculates the factorial of a number. factorial(6); // 720

Calculates the factorial of a number. factorial(6); // 720

Parameters

$n

Returns

float|integer
public static float|integer
# average( mixed $items )

Returns the average of two or more numbers. average(1, 2, 3); // 2

Returns the average of two or more numbers. average(1, 2, 3); // 2

Parameters

$items
$items

Returns

float|integer
public static boolean|string
# convertCurrencyToBitcoin( integer $amount = 500, string $currency = 'USD' )

Parameters

$amount
$currency

Returns

boolean|string
API documentation generated by ApiGen