Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Published by Scroll Versions from space DEV and version r0821

The following example demonstrates how the rounding functions work together. These functions include the following:

  • FLOOR - largest integer that is not greater than the input value. See FLOOR Function.
  • CEILING - smallest integer that is not less than the input value. See CEILING Function.
  • ROUND - nearest integer to the input value. See ROUND Function.
  • MOD - remainder integer when input1 is divided by input2. See Numeric Operators

Source:

rowNumX
1-2.5
2-1.2
30
41
51.5
62.5
73.9
84
94.1
1011

Transformation:

D trans
RawWrangletrue
p03Value'floorX'
Typestep
WrangleTextderive type: single value: FLOOR (X) as: 'floorX'
p01NameFormula type
p01ValueSingle row formula
p02NameFormula
p02ValueFLOOR(X)
p03NameNew column name
SearchTermNew formula

D trans
RawWrangletrue
p03Value'ceilingX'
Typestep
WrangleTextderive type: single value: CEILING (X) as: 'ceilingX'
p01NameFormula type
p01ValueSingle row formula
p02NameFormula
p02ValueCEILING(X)
p03NameNew column name
SearchTermNew formula

D trans
RawWrangletrue
p03Value'roundX'
Typestep
WrangleTextderive type: single value: ROUND (X) as: 'roundX'
p01NameFormula type
p01ValueSingle row formula
p02NameFormula
p02ValueROUND (X)
p03NameNew column name
SearchTermNew formula

D trans
RawWrangletrue
p03Value'modX'
Typestep
WrangleTextderive type: single value: (X % 2) as: 'modX'
p01NameFormula type
p01ValueSingle row formula
p02NameFormula
p02Value(X % 2)
p03NameNew column name
SearchTermNew formula

Results:

rowNumXmodXroundXceilingXfloorX
1-2.5 -2-2-3
2-1.2 -1-1-2
300000
411111
51.5 221
62.5 332
73.9 443
840444
94.1 454
10111111111