comma_formatter

class comma_formatter #(type T =  int) extends formatter#( T )

singleton Provides a strategy to convert an object of integral data types such as int and time into a string using a decimal format that has commas as thousands separators for better readability.

Parameter

Toptional The type of an object to be converted.  The default is int.
Summary
comma_formattersingleton Provides a strategy to convert an object of integral data types such as int and time into a string using a decimal format that has commas as thousands separators for better readability.
Types
this_typeThe shorthand of comma_formatter #(T).
Functions
newprotected Creates a new formatter.
get_instancestatic Returns the singleton instance of this formatter.
to_stringvirtual Returns a string representation of the given object of type T.

Types

this_type

typedef comma_formatter#(T) this_type

The shorthand of comma_formatter #(T).

Functions

new

protected function new()

protected Creates a new formatter.

get_instance

static function this_type get_instance()

static Returns the singleton instance of this formatter.

Returns

The singleton instance.

to_string

virtual function string to_string(o)

virtual Returns a string representation of the given object of type T.

Argument

oAn object to convert to a string.

Returns

A string representing o.

class comma_formatter #(type T =  int) extends formatter#( T )
singleton Provides a strategy to convert an object of integral data types such as int and time into a string using a decimal format that has commas as thousands separators for better readability.
typedef comma_formatter#(T) this_type
The shorthand of comma_formatter #(T).
protected function new()
protected Creates a new formatter.
static function this_type get_instance()
static Returns the singleton instance of this formatter.
virtual function string to_string(o)
virtual Returns a string representation of the given object of type T.