SummaryHelper
in package
Base utility class to handle information display.
Table of Contents
Methods
- cleanOutString() : string
- Properly formats carriage returns in a string and remove leading spaces before them.
- formatFloat() : string
- Formats decimal numbers for display, by removing all excess digits after the fifth.
- formatForDisplay() : string
- Truncates line-items to the max width of their corresponding column.
- escapeSpecialChars() : string|null
- Prepends carriage return, new line & tab symbols with a backslash in a string.
Methods
cleanOutString()
Properly formats carriage returns in a string and remove leading spaces before them.
public
static cleanOutString(string $inputString) : string
Parameters
- $inputString : string
-
String to clean.
Return values
stringformatFloat()
Formats decimal numbers for display, by removing all excess digits after the fifth.
public
static formatFloat(float|null $number) : string
Parameters
- $number : float|null
-
Number to parse.
Return values
string —Number as a valid float string.
formatForDisplay()
Truncates line-items to the max width of their corresponding column.
public
static formatForDisplay([string|bool|null $inputString = null ][, int|null $maxColSize = null ]) : string
Parameters
- $inputString : string|bool|null = null
-
String to check.
- $maxColSize : int|null = null
-
Maximum size for the current column, if it exists.
Return values
stringescapeSpecialChars()
Prepends carriage return, new line & tab symbols with a backslash in a string.
protected
static escapeSpecialChars(string|null $string) : string|null
Parameters
- $string : string|null
-
The string to fix.
Return values
string|null —The fixed string.