Subscribe to this thread
Home - General / All posts - Manifold 9 - Edit Schema
steveFitz

198 post(s)
#20-Apr-18 05:22

I'm using M9 9.0.166.4 (15th April 2018).

When I open and save a Manifold 8 project my Floating-point (single) fields are turned into Float32 with lots of decimal places. They don't look so good in labels now.

I open Edit > Schema to change the fields to show less decimals but I'm not allowed to change the 'Type:' which has 'float32' greyed out.

I've had a look at the documentation and here on the forum using "Edit Schema" as the search words and read the Schema info

The table seems to have indexes - mfd_id_x (btree) and Geom (I)_x (rtree).

Dimitri


4,843 post(s)
#20-Apr-18 10:39

I open Edit > Schema to change the fields to show less decimals but I'm not allowed to change the 'Type:' which has 'float32' greyed out.

Correct. Like most high end DBMS, you don't change types in a schema in Manifold. Instead, create a new field that is the type you want and then use Transform to copy your data into that new field. Most transformations between types for numbers happen automatically, but if need be you could use CAST for the transformation (see the examples in the Transform template topics on using CAST).

What would be nicer would be to have Style enabled for table windows, so you could just force the display format into being whatever you want regardless of the type. I, for example, don't like having a bunch of "0" digits in my date time fields when all I care about is the date, not time.

adamw


7,903 post(s)
#20-Apr-18 13:51

The data is the same but it is now formatted differently. 9 formats floating-point values differently from 8 by default (both try to minimize the number of digits while still reporting the number and 9 is more precise, 8 ends up rounding where 9 doesn't).

We will add means to control the format of field values in the table cells / labels.

dchall8
436 post(s)
#20-Apr-18 14:44

I had a decimal point issue, too. I created a computed field to change area from square feet to acres and at the same time round off the decimal places to 3. Here is the Expression used in the Schema <new field>.

RoundDecs(GeomArea([Geom (I)], 0) / 43560, 3)

If you don't want to divide anything by 43560 you could leave out the / 43560 part.

steveFitz

198 post(s)
#23-Apr-18 06:17

Thanks everyone.

I'll investigate computed fields in 9.

Dimitri


4,843 post(s)
#24-Apr-18 06:10

Useful examples of computed fields are here and here and the Tanaka example and an example of using CAST at the end of this example.

Manifold User Community Use Agreement Copyright (C) 2007-2017 Manifold Software Limited. All rights reserved.