SilverShop\ORM\FieldType\ShopCurrency
Improvements to Currency for presenting in templates.
Synopsis
class ShopCurrency
extends DBCurrency
{
- // members
- private static string $decimal_delimiter = '.';
- private static string $thousand_delimiter = ',';
- private static boolean $append_symbol = false;
- private static bool $use_free_text = false;
- private static string $negative_value_format = '<span class="negative">(%s)</span>';
- private static array $casting = ;
- // methods
- public void Nice()
- public void forTemplate()
- public string TrimCents()
- public void NiceOrEmpty()
Hierarchy
Extends
- SilverStripe\ORM\FieldType\DBCurrency
Members
private
- $append_symbol
—
string
Whether or not to append the currency symbol to - $casting
- $decimal_delimiter
—
string
The shop currency decimal delimiter - $negative_value_format
—
string
HTML to use for negative numbers - $thousand_delimiter
—
string
The shop currency thousands delimiter - $use_free_text
—
SilverShop\ORM\FieldType\bool
Whether or not to use a textual 'free' instead of 0.00
Methods
public
- Nice()
- NiceOrEmpty()
- TrimCents() — If no cents on the price, trim those off.
- forTemplate()