withCurrencySymbol property
String
get
withCurrencySymbol
!~~~~~~~~~~~~~~~~~~~~~~~ Currency Symbol ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Returns a new string with the currency symbol prefixed to the original string.
we can set any currency symbol statically or dynamically as per requirement. Example:
"100".withCurrencySymbol; // Returns "₹ 100"
"1000.50".withCurrencySymbol; // Returns "₹ 1000.50"
"".withCurrencySymbol; // Returns "₹ "
Returns: A String with the currency symbol.
Implementation
String get withCurrencySymbol => '₹ $this';