Skip to content

Functions and predicate based on characters for currency #171

@Seddryck

Description

@Seddryck
  • char-currency: returns true if the text has a length of one and the char is one of the currency symbols. The list is defined there
  • retain-numeric-symbol-currency only retain numeric, symbol (+-,.) and currency characters
  • matches-money: returns true if the text is a money pattern meaning that it only contains spaces, numeric, symbols ,. and currency symbols. The currency symbol must be at the beginning or end of the trimmed text, the decimal separator must be preceded and followed by at least a numeric symbol and the group separator must be preceded by at least one character and maximum 3 and followed by 3.

valid

$1
$100
$1000
$1,000
$1,000,000
$100,000,000
$100,000.01
$0.01

Invalid

1$10
$5,00
$1000,100
$.10
.10$
,.10$

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementEnhancement to an existing feature

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions