-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathText.IsDigits
More file actions
17 lines (17 loc) · 810 Bytes
/
Text.IsDigits
File metadata and controls
17 lines (17 loc) · 810 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
let
func = (TextValue as text) as logical =>
let
//Convert the seed text into a list
SeedList = Text.ToList(TextValue),
//Generate a list of digit characters (ASCII codes 48-57)
ComparisonList = List.Transform({48..57}, each Character.FromNumber(_)),
//Compares content from ControlList against SeedList
ListComparison = List.ContainsAll(ComparisonList, SeedList)
in
ListComparison,
documentation = [
Documentation.Name = "Text.IsDigits",
Documentation.LongDescription = "This function takes a text value and verifies whether the value consists entirely of digit characters (ASCII codes 48-57) and returns true if all characters are digits, otherwise false."
]
in
Value.ReplaceType(func, Value.ReplaceMetadata(Value.Type(func), documentation))