Rounding Hack
Because Release 4.50 does not automatically round double, floating point numbers, it's annoying to have entered values like "6.40" and see them printed as labels in maps as "6.39999...".
If you don't mind using Table View Calculator, here are two approaches:
Option A: Quick and Dirty

Suppose we have a floating point field called "float" that we use to create labels. We would like to avoid the above effect.

We begin by creating a text field, called text1 in this example. We highlight all values and then use Table View Calculator to copy the float values to the text1 field. Note that Table View Calculator works only on the highlighted values. Note also that floating point to string conversion is done automatically within the resolution of the conversion function.

Next, we can use the delete right operator to trim off the last four characters from the string. We can then use text1 as the field from which labels are made:

The above method is fast, but the use of delete right results in imperfect rounding. 9.876 does not round to 9.87... it rounds to 9.88. If exact rounding is desired, we have to do some arithmetic.
Option B: Precise and Tedious
If you don't mind using the Table View Calculator every time the numbers change, here is a frightfully tedious hack that will enable the numbers to be printed with a limited number of decimal points. Suppose we want 33.389721999999999 to print as 33.39. [In the illustration below, this is the third row in the table illustrated.]
We do the following steps, where the numbers after the step say what's in the target field. This presumes familiarity with the Table View Calculator capability in Manifold System Release 4.50. This is just one uninspired approach. There are lots of ways to do exact rounding using a different sequence of steps.
1. Copy the value to a double field. 33.389721999999999
2. Multiply by 100. 3338.9721999999999
3. Round. 3339
4. Copy to a string field called StringA. "3339.000000" [the conversion to a string yields six zeros after the decimal point]
5. Also copy to a string field called StringB. "3339.000000"
6. Delete right 9 of StringA. "33"
7. Leave right 9 of StringB. "39.000000"
8. Delete right 7 of StringB. "39"
9. Create new string field StringC.
10. Copy StringA to StringC. "33"
11. Concatenate String C with "." "33."
12. Concatenate StringC with StringB "33.39"
13. Print the label using StringC.

The illustration above shows Table View Calculator being used in a similar fashion to "round off" a latitude number phrased as a double. The image shows the Table View just after pressing Apply in the last concatenate with command.
Release 5.00 (to no one's surprise!) will provide rounding and other format control capabilities.
Visit the Manifold.net Online Store
anytime to purchase
Manifold products. Details
regarding shipping and purchasing may be found on the Online Store's information pages as
well as on the Miscellaneous Info
page. Email sales@manifold.net at
any time, or call 800-556-5919 during business hours if you have any
questions regarding products, purchasing, or shipping information.
|
Home Page -
Products -
Search -
Support -
Shopping -
News -
Online Store Prices, terms and conditions, and product specifications subject to change without notice. Please contact Manifold Net with any special needs or requests. |