[Solved] Number format icon for Comma 0

Discuss the spreadsheet application
Locked
Notso
Posts: 3
Joined: Wed Sep 04, 2024 11:32 pm

[Solved] Number format icon for Comma 0

Post by Notso »

Using 4.1.15 version, Win 10, and in the toolbar there are icons for formatting numbers in cells. One that is missing (on mine at least) is the icon for formatting the cell (or range) to Comma 0. I've looked in the available toolbar options, and couldn't find it.

Is there one that can be positioned on the tool bar, and how do I get access to it?

I did a search but came up with nothing.

Thanx.
Last edited by MrProgrammer on Sat Sep 14, 2024 5:29 pm, edited 2 times in total.
Reason: Tagged ✓ [Solved] -- MrProgrammer, forum moderator
Open Office 4.1.15 on Windows 10
User avatar
robleyd
Moderator
Posts: 5505
Joined: Mon Aug 19, 2013 3:47 am
Location: Murbko, Australia

Re: Number formatting icon

Post by robleyd »

Can you explain what you mean by Comma 0? Is it inserting a comma as thousands separator, or something else?
Slackware 15 (current) 64 bit
Apache OpenOffice 4.1.16
LibreOffice 26.2.3.2; SlackBuild for 26.2.3 by Eric Hameleers
---------------
I hate this damn computer, I wish that I could sell it.
It won't do what I want it to, Only what I tell it.
Notso
Posts: 3
Joined: Wed Sep 04, 2024 11:32 pm

Re: Number formatting icon

Post by Notso »

Comma zero is essentially like currency formatting without the "$" sign. And it has 0 decimals. Excel spreadsheets have it, and I suspect it's available on Calc, but I just can't find it, or add it to the tool bar.
Open Office 4.1.15 on Windows 10
User avatar
robleyd
Moderator
Posts: 5505
Joined: Mon Aug 19, 2013 3:47 am
Location: Murbko, Australia

Re: Number formatting icon

Post by robleyd »

like currency formatting without the "$" sign. And it has 0 decimals
That doesn't make sense; currency formatting has two decimal places.

Perhaps you could create a cell style with the required format attributes; you can assign a shortcut key combination to the style with Tools | Customise and select Keyboard tab. Search in HELP - F1 - for format codes for more detail on formatting.
Slackware 15 (current) 64 bit
Apache OpenOffice 4.1.16
LibreOffice 26.2.3.2; SlackBuild for 26.2.3 by Eric Hameleers
---------------
I hate this damn computer, I wish that I could sell it.
It won't do what I want it to, Only what I tell it.
User avatar
keme
Volunteer
Posts: 3791
Joined: Wed Nov 28, 2007 10:27 am
Location: Egersund, Norway

Re: Number formatting icon

Post by keme »

Only the most common formatting options are available as toolbar icons. For explicit formatting, you need to use the cell format dialog (or better, create a cell style).

The cell style editor and cell format dialog look mostly the same. Select the Numbers tab and in the Format code field you type three characters: #,0 (That is hash-character - Comma - Zero)

This is assuming that your comma is the decimal separator and you do not want to display leading zeroes to the left of comma. # and 0 are nearly equivalent digit placeholders for the format: The "0" placeholder means "show superfluous zeroes" while the "#" hides them.
Notso
Posts: 3
Joined: Wed Sep 04, 2024 11:32 pm

Re: Number formatting icon

Post by Notso »

Sorry I was unclear. Comma 0, is a thousands separator with 0 decimal places. I can certainly do that by right clicking the cell/range and enter the formatting menu. I was just looking for a shortcut icon to place on the tool bar to make it simpler.
Open Office 4.1.15 on Windows 10
User avatar
keme
Volunteer
Posts: 3791
Joined: Wed Nov 28, 2007 10:27 am
Location: Egersund, Norway

Re: Number formatting icon

Post by keme »

Notso wrote: Thu Sep 05, 2024 2:46 pm Sorry I was unclear. Comma 0, is a thousands separator with 0 decimal places. I can certainly do that by right clicking the cell/range and enter the formatting menu. I was just looking for a shortcut icon to place on the tool bar to make it simpler.
Then you use a different format code: #,### if you want zero values to appear as blank, or #,##0 to show a single zero digit.
User avatar
MrProgrammer
Moderator
Posts: 5430
Joined: Fri Jun 04, 2010 7:57 pm
Location: Wisconsin, USA

Re: Number format icon for Comma 0

Post by MrProgrammer »

Notso wrote: Thu Sep 05, 2024 2:46 pm Comma 0, is a thousands separator with 0 decimal places. I can certainly do that by right clicking the cell/range and enter the formatting menu. I was just looking for a shortcut icon to place on the tool bar to make it simpler.
Select the cell. Record a macro: Tools → Macros → Record → Format → Cells → Numbers → Category:Number → Format:-1,234 (select that from the list) → OK → Stop recording → Give your macro a name and save it. I tested that a macro which I created will apply that number format to a cell or cell range.

[Tutorial] Favorite Recorded Calc Macros

To put the macro on a toolbar try: Tools → Customize → Toolbar → Toolbar:Formatting → Add → Category:OpenOffice Macros → Select your macro → Add → Close → Position the macro on the toolbar as desired using the ⬆︎⬇︎ buttons → OK. I don't use toolbars so I don't know what options you might have in that dialog for choosing an icon.

Personally I would create a style for that cell format and record applying the style instead using Format → Cells. I would save the style in my default Calc template so it's available in any spreadsheet which I create.

Getting Started Guide, Chapter 3: Using Styles and Templates

If this solved your problem please go to your first post use the Edit button and add [Solved] to the start of the Subject field. Select the green checkmark icon at the same time.

[Tutorial] Ten concepts that every Calc user should know
Mr. Programmer
AOO 4.1.7 Build 9800, MacOS 13.7.8, iMac Intel.   The locale for any menus or Calc formulas in my posts is English (USA).
Locked