Hi guys - Was the question in regard to controlling the display precision (number of digits) of the rounded number? If so - how about converting to string and parsing. I'm doing this in a rule i'm working on. Note: The caveat in my case is that I had to output the values as string to prevent the stripping of the extra zeros - but that was fine as mine are input values for a drawing (besides, numeric strings can later convert back to real with no problem). Here's an excerpt of my rule which successfuly rounds, and then displays length values - hope it helps:
Danny
/* CUT HERE =======================================*/
PtCoord = 1.5in /* TEMPORARY - REMOVE!!!! */
RoundedString = ToString( round( PtCoord /.0254 , "", DesiredPrecision )) /* Multiplying Length by 1 converts to required input type of Real */
DecimalIndex = RoundedString ->Search( "." ) /* Locate the index of the decimal in the number - add one if necessary */
if DecimalIndex == -1 /* Add a decimal if necessary */
{
RoundedString = RoundedString + "."
DecimalIndex = RoundedString ->Search( "." )
}
DigitsAfterDecimal = ( RoundedString .Length()) - ( DecimalIndex ) -1 /* Determine how many zeros must be added and add them */
ZerosToAdd = DesiredPrecision - DigitsAfterDecimal
OutputString = RoundedString
Zeros = 1
for Zeros while Zeros <= ZerosToAdd { OutputString = OutputString + "0" }
OutputParmName = OutputsNameList ->GetItem( i ) /* Get the output string param and set its value */
StringsFeatureIN ->SetAttributeString( OutputParmName , OutputString )
/* CUT HERE =======================================*/