# Formatting Numbers (1 Viewer)

M

#### marchristensen

##### Guest
I have an Access report with two columns (fields). Column 1 is a text description and Column 2 is a number. I need Column 2 to be in number format so I can perform some calculations. I also need different number formats to appear in Column 2.

One record might have an entry of 30000 which I need to appear as 30,000 with no decimal places. Another number might be 0.1234 where I need four decimal places to appear with the leading 0. Another number might be 300.050 in which I need the final 0 to appear. Another number might be .025 which I need to appear as 2.50% How can I make this happen?

Thanks

#### Travis

##### Registered User
The question I have to ask is this:

What are the rules?

How do you know how the number needs to be formated?

If the rule is in the Record or is definable, then an field that has a control source of a function can be used to set the value. But the most important part is figuring out what is the rule.

M

#### marchristensen

##### Guest
Rules are based on record number

Travis
Thanks for answering so quickly. There are 'rules' but not in the traditional sense of the word. The rules are based on record number. The first record in the report will always have no decimal places and need a comma in the thousands. The second record of the report will always need three decimal places
BUT
As I am writing this, I think you have absolutely come up with the solution. I will add a third field to the table which will determine how the number in the second field is displayed. If the third field entry is 'thousands', I will display the number as thousands, with no decimal places. If the third field entry is 'threedec', I will display the second field with three decimal places. I think that will work very nicely.

Do you have a better idea?
Thanks again.
Lynn

#### Travis

##### Registered User
No, that was where I was going with my questions.

#### Pat Hartman

##### Super Moderator
Staff member
Your table structure sounds over-normalized. A rare event for this forum.