Difference between revisions of "Manuals/calci/DIGITS"
Jump to navigation
Jump to search
Line 152: | Line 152: | ||
*a=1..10.fillwith(1..3).buckets(); | *a=1..10.fillwith(1..3).buckets(); | ||
b=FLATTENOBJECT(a); | b=FLATTENOBJECT(a); | ||
− | 1 | + | {|id="TABLE3" class="SpreadSheet blue" |
− | 2 | + | {| |
− | 3 | + | |- class="even" |
+ | | class=" " | | ||
+ | | class="sshl_f" | 1 | ||
+ | | class="sshl_f" | 4 | ||
+ | |||
+ | |- class="odd" | ||
+ | | class="sshl_f" | 2 | ||
+ | | class="sshl_f" | 3 | ||
+ | |||
+ | |- class="even" | ||
+ | | class="sshl_f" | 3 | ||
+ | | class="sshl_f" | 3 | ||
+ | |} | ||
==Example== | ==Example== |
Revision as of 03:22, 11 February 2020
DIGITS(SomeNumberOrEmpty)
Description
- If a parameter is provided for SomeNumberOrEmpty, the function an array consisting of every digit in the number.
- This function shows the digits 0 to 9, if no parameters are given.
- Digits is any of the numerals from 0 to 9, especially when forming part of a number.
Inner
- 1..100.inner(2) displaying skip first 2 numbers and give inner elements.
- 1..100.inner(2)=3 4 5 6 7 8 9 10 11 ..98.
Outer
- 1..100.outer() displays outer 2 elements.
- 1..100.outer() = 1 100
- 1..100.outer(2) gives outer including some (2 here) elements.
- 1..100.outer(2) = 1 2 99 100
Slices
- 1..100.allslices() gives slices of numbers of length 1 to end.
- 1..10.allslices(true) gives reverse slices of length 1 to end.
- 1..10.allslices(true)
10 | |||||||||
10 | 9 | ||||||||
10 | 9 | 8 | |||||||
10 | 9 | 8 | 7 | ||||||
10 | 9 | 8 | 7 | 6 | |||||
10 | 9 | 8 | 7 | 6 | 5 | ||||
10 | 9 | 8 | 7 | 6 | 5 | 4 | |||
10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | ||
10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | |
10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 |
Buckets
- 1..10.buckets() returns an object with key frequency pairs.
"1": 1, | |
"2": 1, | |
"3": 1, | |
"4": 1, | |
"5": 1, | |
"6": 1, | |
"7": 1, | |
"8": 1, | |
"9": 1, | |
"10": 1, |
- a=1..10.fillwith(1..3).buckets()
"1": 4, | |
"2": 3, | |
"3": 3, |
- a=1..10.fillwith(1..3).buckets();
b=FLATTENOBJECT(a);
1 | 4 | |
2 | 3 | |
3 | 3 |
Example
- DIGITS() = 1234567890
- DIGITS(38) = ["3","8"]
- DIGITS(1..100)=1 2 3 4 5 6 7 8 9 10...........100
Related Videos
See Also
References