You are Here: Home >< Maths

# What is the term to use which says print decimal places only if not zero Watch

1. I have a programming problem where I need to print decimal digits if they are non-zero.

This after adding two numbers. Eg if the sum is 5 + 4 then only print 9.

If the sum is 5.7 + 4, then print 9.7

And if the sim is 7.1 + 3.222 then print 10.3222

Excel actually does this.

Is there a mathematical term to describe this truncating or process of displaying decimal digits?
2. (Original post by acomber)
I have a programming problem where I need to print decimal digits if they are non-zero.

This after adding two numbers. Eg if the sum is 5 + 4 then only print 9.

If the sum is 5.7 + 4, then print 9.7

And if the sim is 7.1 + 3.222 then print 10.3222

Excel actually does this.

Is there a mathematical term to describe this truncating or process of displaying decimal digits?
Suppress trailing decimal zeroes?

Best guess. It will be a computing term, rather than mathematical, per se, but I'm not aware of any standard.
3. I wondered if there was a term. In printf in C the %g format specifier does this.
4. (Original post by acomber)
I wondered if there was a term. In printf in C the %g format specifier does this.
"trailing zero(e)s" seems to be the general term. Some languages don't seem to have anything, and require code to perform this task - from a quick Google.

One should note that 1.00 implies a greater degree of accuracy than just 1.

TSR Support Team

We have a brilliant team of more than 60 Support Team members looking after discussions on The Student Room, helping to make it a fun, safe and useful place to hang out.

This forum is supported by:
Updated: April 18, 2016
Today on TSR

### Am I pregnant?

...or just paranoid?

### Have I ruined my eyebrows

Discussions on TSR

• Latest
• ## See more of what you like on The Student Room

You can personalise what you see on TSR. Tell us a little about yourself to get started.

• Poll
Useful resources

### Maths Forum posting guidelines

Not sure where to post? Read the updated guidelines here

### How to use LaTex

Writing equations the easy way

### Study habits of A* students

Top tips from students who have already aced their exams

## Groups associated with this forum:

View associated groups
Discussions on TSR

• Latest
• ## See more of what you like on The Student Room

You can personalise what you see on TSR. Tell us a little about yourself to get started.

• The Student Room, Get Revising and Marked by Teachers are trading names of The Student Room Group Ltd.

Register Number: 04666380 (England and Wales), VAT No. 806 8067 22 Registered Office: International House, Queens Road, Brighton, BN1 3XE

Reputation gems: You get these gems as you gain rep from other members for making good contributions and giving helpful advice.