[Solved] Show result with no decimal places

Discuss the spreadsheet application
Post Reply
davidflynn9
Posts: 4
Joined: Thu Sep 02, 2021 7:14 pm

[Solved] Show result with no decimal places

Post by davidflynn9 »

This code does what I want but im stuggling to figure out how to make it show nothing after the decimal.

Code: Select all

=IF(ISERROR(C4/E4)*100;"";(C4/E4)*100)
like it reads out my number example 32.333333 i would like it make it only show 32
Last edited by MrProgrammer on Thu Nov 18, 2021 1:28 am, edited 2 times in total.
Reason: Tagged [Solved].
Windows 10, openoffice 4.1.7
FJCC
Moderator
Posts: 9271
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: Code problem

Post by FJCC »

Select the cell and then use the menu Format -> Cells to set the number of decimal places on the Numbers tab.
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
User avatar
RusselB
Moderator
Posts: 6646
Joined: Fri Jan 03, 2014 7:31 am
Location: Sarnia, ON

Re: Code problem

Post by RusselB »

FJCC's suggestion changes the display, but not the actual number.
If you want the actual number changed, wrap the last term of your IF in an INT function.
OpenOffice 4.1.7, LibreOffice 7.0.1.2 on Windows 7 Pro, Ultimate & Windows 10 Home (2004)
If you believe your problem has been resolved, please go to your first post in this topic, click the Edit button and add [Solved] to the beginning of the Subject line.
davidflynn9
Posts: 4
Joined: Thu Sep 02, 2021 7:14 pm

Re: Code problem

Post by davidflynn9 »

Thank you all that solved my problem!
Windows 10, openoffice 4.1.7
Post Reply