Question

attribute rounding to other than numerical convention, or truncation.

  • 30 January 2017
  • 2 replies
  • 1 view

I have an ascii xyz file i need to convert to a hyd93 (binary) format. The z value needs to be rounded to a nonstandard non-numerical rounding,(precision of 2-3 decimal places to one decimal place, 0.n99 and up round up, otherwise round down) or truncated. coordinate rounder does not seem to offer the needed functionality. Is ther another transfromer that has the needed functionality, rounding or truncation?


2 replies

Badge +16

Have a look at the StringFormatter for truncating and the attributerounder for rounding.

I think you will need to come up with your own rounding mechanism by truncating via the StringFormatter and testing the decimal number to decide with ones to round.

Hope this helps.

Userlevel 2
Badge +17

Hi @cruiserad, I would try the following two steps:

  1. Add 0.001 to the z value.
  2. Round off the resulting value with the AttributeRounder (Decimal Place: 1, Round-Off Direction: Down).

Reply