StringAttributeRounder
From Fmepedia
| This page contains a Custom Transformer created by an fmepedia user. See the attached files list at the foot of this page for the zip file containing this custom transformer. |
Created by: Mark Ireland
The StringAttributeRounder (and alternative FME2007 version) is a form of AttributeRounder that can handle attributes containing text as well as numbers in a single string. The user can choose whether the text part of the string is at the start or end of the string.
The rounding direction is always equivalent to "nearest", though it wouldn't be hard to expose this parameter for run-time setting by the user.
Examples:
Start Attribute: m234.5555 Text Part At: Start Decimal Places: 2 Result: m234.56
Start Attribute: 234.5555m Text Part At: End Decimal Places: 2 Result: 234.56m
The transformer also handles <space> characters, for example:
Start Attribute: x y234.5555 Text Part At: Start Decimal Places: 2 Result: x y234.56
