mirror of
https://github.com/odin-lang/Odin.git
synced 2026-04-18 20:40:28 +00:00
Add procedure is_decimal
This adds the function `is_decimal` to `core/unicode`
This commit is contained in:
committed by
Jeroen van Rijn
parent
263bc8cc7e
commit
e5b1f1bf94
@@ -131,6 +131,20 @@ is_title :: proc(r: rune) -> bool {
|
||||
return is_upper(r) && is_lower(r)
|
||||
}
|
||||
|
||||
/*
|
||||
Returns true if the rune `r` is in the General Category Nd
|
||||
|
||||
Inputs:
|
||||
- r: The run to check if it is in the general category Nd.
|
||||
|
||||
Returns:
|
||||
`true` if the rune is in the general category Nd and `false` otherwise
|
||||
|
||||
*/
|
||||
is_decimal :: proc(r: rune) -> bool {
|
||||
return in_range(r, nd_ranges)
|
||||
}
|
||||
|
||||
/*
|
||||
This function determincs if a rune is a digit. To be a digit the
|
||||
charage either has a Numeric_Type of Digit or Decimal.
|
||||
|
||||
Reference in New Issue
Block a user