Skip to main content
Question

attribute rounding to other than numerical convention, or truncation.


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

itay
Supporter
Forum|alt.badge.img+16
  • Supporter
  • January 30, 2017

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.


takashi
Contributor
Forum|alt.badge.img+19
  • Contributor
  • January 30, 2017

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).

Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings