Number formatting with %
-
- Posts: 4
- Joined: Sun Jul 26, 2015 8:51 pm
Number formatting with %
I'm trying to setup a format code for numbers so that it rounds to one decimal place, but not if they are whole numbers. After some research, I found that the format code #.#;0 accomplishes this. However, when I try to do the same thing with %, it gets a bit weird. I tried both #.#%;0% and 0%;#.#% , and it seemingly will only use whichever one comes first. I'm admittedly fairly new to the program though, so it's very possible I'm missing something pretty obvious. I apologize if that's the case.
OpenOffice 4.1.1
Windows 7 Home Premium SP1
Windows 7 Home Premium SP1
Re: Number formatting with %
Value ... Formatted as percent:
25 ... 2500%
1 ... 100%
2 ... 200%
0.5 ... 50%
0.025 ...2.5%
25 ... 2500%
1 ... 100%
2 ... 200%
0.5 ... 50%
0.025 ...2.5%
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Re: Number formatting with %
In order to have multiple possible formats for a single cell, you need to use the Conditional Brackets, as described in the Help file under format codes;numbers
You'll have to experiment with the details to get the exact formatting you want for specific numbers.
You'll have to experiment with the details to get the exact formatting you want for specific numbers.
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.
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.
-
- Posts: 4
- Joined: Sun Jul 26, 2015 8:51 pm
Re: Number formatting with %
Thanks, I'll look into that. Out of curiosity though, why does it work with standard numbers when I use multiple formats seperated by a semi-colon, but not when I add % into it?RusselB wrote:In order to have multiple possible formats for a single cell, you need to use the Conditional Brackets, as described in the Help file under format codes;numbers
You'll have to experiment with the details to get the exact formatting you want for specific numbers.
OpenOffice 4.1.1
Windows 7 Home Premium SP1
Windows 7 Home Premium SP1
Re: Number formatting with %
"Does not work" is not a valid problem description.
What do you enter?
What do you expect to see?
What is displayed instead?
What do you enter?
What do you expect to see?
What is displayed instead?
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
-
- Posts: 4
- Joined: Sun Jul 26, 2015 8:51 pm
Re: Number formatting with %
0 with the format code 0%;#.#% turns up: 0%Villeroy wrote:"Does not work" is not a valid problem description.
What do you enter?
What do you expect to see?
What is displayed instead?
This is what I'd like, but I believe it's working like that only because of the first part of the format code before the semi-colon.
0 with the format code #.#%;0% turns up: .%
Obviously that looks a bit silly. It seems to be for the same reason, where it's only taking into account the #.#%, and nothing after the semi-colon.
.3333(repeating) with the format code 0%;#.#% turns up: 33%
.3333(repeating) with the format code #.#%;0% turns up: 33.3%
Behaving the same way as it did with 0. I'd like a way to apply a single format code to all the cells in this column that works. However, 33.3% and 0% (the two results I want in this case) require different codes, out of what I've come up with at least.
As for what I expected to see, I thought it would work the same was as those formats would if there was not a % involved. The format code #.#;0 is able to give me both 4 and 13.1, rather than turning 4 into 4.0 or turning 13.1 to 13.
OpenOffice 4.1.1
Windows 7 Home Premium SP1
Windows 7 Home Premium SP1
Re: Number formatting with %
Please upload your example .ods file here - with some formatted values (and those format codes)...Out of curiosity though, why does it work with standard numbers when I use multiple formats seperated by a semi-colon, but not when I add % into it?
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
-
- Posts: 4
- Joined: Sun Jul 26, 2015 8:51 pm
Re: Number formatting with %
It's a mess for now of course, but C2-4 is where the format codes I can't figure out are meant to be. F,G, and H 2-4 are where the non-% format codes are working as expected and as desired.Zizi64 wrote:Please upload your example .ods file here - with some formatted values (and those format codes)...Out of curiosity though, why does it work with standard numbers when I use multiple formats seperated by a semi-colon, but not when I add % into it?
- Attachments
-
- ARAM Stats.ods
- (14.72 KiB) Downloaded 62 times
OpenOffice 4.1.1
Windows 7 Home Premium SP1
Windows 7 Home Premium SP1