TypeConverter
FinalYes
Table of Contents
Methods
- convertToDate() : Date|bool
- Converts value to Date
- convertToDateTime() : DateTime|bool
- Converts value to Date with time
- convertToDouble() : float
- Converts value to double
- convertToInt() : int|null
- Converts value to int
- convertToMoney() : float
- Converts value to money (double)
- convertToString() : string
- Converts value to string
Methods
convertToDate()
Converts value to Date
public
static convertToDate(string $value, string $format) : Date|bool
Parameters
- $value : string
- $format : string
Tags
Return values
Date|boolconvertToDateTime()
Converts value to Date with time
public
static convertToDateTime(string $value, string $format) : DateTime|bool
Parameters
- $value : string
- $format : string
Tags
Return values
DateTime|boolconvertToDouble()
Converts value to double
public
static convertToDouble(mixed $value[, int|null $precision = null ][, string $delimiter = '.' ]) : float
Parameters
- $value : mixed
- $precision : int|null = null
- $delimiter : string = '.'
Tags
Return values
floatconvertToInt()
Converts value to int
public
static convertToInt(mixed $value) : int|null
Parameters
- $value : mixed
Return values
int|nullconvertToMoney()
Converts value to money (double)
public
static convertToMoney(mixed $value[, int|null $precision = null ][, string $delimiter = '.' ]) : float
Parameters
- $value : mixed
- $precision : int|null = null
- $delimiter : string = '.'
Tags
Return values
floatconvertToString()
Converts value to string
public
static convertToString(mixed $value) : string
Parameters
- $value : mixed