This is actually because MapInfo turns numbers to integers to characters 
when it concatenates.  This gets rid of the commas.  You can use functions 
to make it work though.  I actually answered a version of this for one of 
my training clients before.  We wrote up a quick FAQ for them.  While it 
actually covers two related topics and isn't in the exact columns you used, 
it should answer your question nicely plus add in carriage returns if you 
want them also.

Formatting Labels to have multiple columns, commas and carriage returns


First was the labeling of the areas with state names and the population 
figures.  You'll remember we tried to label the states with their state 
name and with the population of the state.  We were able to do so and also 
able to add in a carriage return between the figures, but they didn't look 
terribly wonderful. Specifically we ended up with 2 spaces between the 
words and the numbers and also the commas disappeared.

First let's cover why.
This is because when it takes the number (the population) and puts it with 
a character field (the state name) both take the properties of a character 
field.  If MapInfo views a number as a character it takes away the commas 
(like how ZIP codes are really characters so we don't get ZIP codes like 
37,027).  If we want them to keep looking like numbers even as a character 
field, we need to reformat them when we put them in the label's expression. 
  (the same happens when you add commas between sets of numbers or words to 
the combined fields etc.).

What we originally did to label them with both the state name and the 
population figure we had to use the auto label feature in layer control to 
label the points with an expression.  This expression was the State name 
plus the population.

This gave us the state name, a space and then the population.  The commas 
though were missing.

The corrected expression is:  State_Name+" "+Format$(Pop_1990, "#,#") 
 which will result in the commas being placed back in the population 
figure.  The second section where it says Format$(Pop_1990,"#,#") will 
format the number part of the field to look like a number again.

If you want to add a single carriage return into this so it looks like the 
state name & then the correctly formatted population on the second line, 
use the following commands:                              State_Name + 
Chr$(13)+ Format$(Pop_1990, "#,#").  The difference here being the Chr$(13) 
which is the function for a carriage return in a label.

Jennifer Duncan
MBS, Inc./Memorial Business Systems Inc.
www.mbs-intl.com
615-373-0110 / 800-844-4447
fax 615-370-4901

-----Original Message-----
From:   Aaron Queheillalt [SMTP:[EMAIL PROTECTED]]
Sent:   Tuesday, June 13, 2000 3:03 PM
To:     'MapInfo-L'
Subject:        MI label expression dropping commas

I was wondering if anyone had any ideas on this one.

I am creating labels with an expression to show several fields of
information.  When I label with one field the numbers are shown with a
comma, such as 230,000.  When I create an expression
(field1+chr$(13)+field2), the numbers shown do not have the comma.  Some of
the numbers are very large and a comma is desired.  I have tried changing
the field type from Integer to Float and as a character without any luck. 
 I
would rather not double-click on each label and add comma's to each one.

Thanks, any ideas would be greatly appreciated


Aaron Queheillalt
Visual/Mapping Analyst
The Sacramento Bee
916-321-1596
 << File: ATT00001.html >>

----------------------------------------------------------------------
To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
"unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]

Reply via email to