XG Proyect

FormatLib
in package

FormatLib class

Table of Contents

colorGreen()  : string
Set a green color
colorNumber()  : string
colorNumber
colorRed()  : string
Set a red color
customColor()  : string
Return a provided color
floatToString()  : string
method floatToString
formatCoords()  : string
Return the coords in format [g:s:p]
formatLevel()  : string
Format the level
getHTMLColorsNameList()  : array<string|int, mixed>
Get a list of all html colors names
getImportanceColor()  : string
Return the color based on the importance
prettyBytes()  : int
prettyBytes
prettyCoords()  : void
Return the coords in format [g:s:p] and links them to the galaxy
prettyNumber()  : string
prettyNumber
prettyTime()  : string
Convert or format a time in seconds to its string representation. Ex.: weeks, days, hours, minutes, seconds
prettyTimeAgo()  : string
prettyTimeAgo
prettyTimeHour()  : string
prettyTimeHour
roundUp()  : int
roundUp
shortlyNumber()  : string
shortlyNumber
spanElement()  : string
Create a new span HTML element
strongText()  : string
strongText

Methods

colorGreen()

Set a green color

public static colorGreen(string $string) : string
Parameters
$string : string

String

Return values
string

colorNumber()

colorNumber

public static colorNumber(int $n[, string $s = '' ]) : string
Parameters
$n : int

Number

$s : string = ''

String

Return values
string

colorRed()

Set a red color

public static colorRed(string $string) : string
Parameters
$string : string

String

Return values
string

customColor()

Return a provided color

public static customColor(string $string, string $color) : string
Parameters
$string : string

String

$color : string

Color

Return values
string

floatToString()

method floatToString

public static floatToString(int $numeric, int $pro[, bool $output = false ]) : string
Parameters
$numeric : int

Number

$pro : int

Pro

$output : bool = false

Output

Return values
string

formatCoords()

Return the coords in format [g:s:p]

public static formatCoords(int $galaxy, int $system, int $planet) : string
Parameters
$galaxy : int
$system : int
$planet : int
Return values
string

formatLevel()

Format the level

public static formatLevel(string $object, string $lvl_string, int $level) : string
Parameters
$object : string
$lvl_string : string
$level : int
Return values
string

getHTMLColorsNameList()

Get a list of all html colors names

public static getHTMLColorsNameList() : array<string|int, mixed>
Return values
array<string|int, mixed>

getImportanceColor()

Return the color based on the importance

public static getImportanceColor(int $priority) : string
Parameters
$priority : int
Return values
string

prettyBytes()

prettyBytes

public static prettyBytes(int $bytes[, int $precision = 2 ][, bool $bitwise = false ]) : int
Parameters
$bytes : int

Bytes

$precision : int = 2

Precision

$bitwise : bool = false

Bitwise Arithmetic

Return values
int

prettyCoords()

Return the coords in format [g:s:p] and links them to the galaxy

public static prettyCoords(int $galaxy, int $system, int $planet) : void
Parameters
$galaxy : int
$system : int
$planet : int
Return values
void

prettyNumber()

prettyNumber

public static prettyNumber(int $n[, bool $floor = true ]) : string
Parameters
$n : int

Number

$floor : bool = true

Floor

Return values
string

prettyTime()

Convert or format a time in seconds to its string representation. Ex.: weeks, days, hours, minutes, seconds

public static prettyTime(int $input_seconds) : string
Parameters
$input_seconds : int
Return values
string

prettyTimeAgo()

prettyTimeAgo

public static prettyTimeAgo(int $datetime[,  $full = false ]) : string
Parameters
$datetime : int

DateTime

$full : = false
Return values
string

prettyTimeHour()

prettyTimeHour

public static prettyTimeHour(int $seconds) : string
Parameters
$seconds : int

Seconds

Return values
string

roundUp()

roundUp

public static roundUp(int $value, int $precision) : int
Parameters
$value : int

Value

$precision : int

Precision

Return values
int

shortlyNumber()

shortlyNumber

public static shortlyNumber( $number) : string
Parameters
$number :
Return values
string

spanElement()

Create a new span HTML element

public static spanElement(string $content[, string|null $class = '' ]) : string
Parameters
$content : string
$class : string|null = ''
Return values
string

strongText()

strongText

public static strongText(string $value) : string
Parameters
$value : string

Value

Return values
string

Search results