There are several built-in number formats available as buttons that can be added to the toolbar:
I want to change Number Format: Decimal from:
to:
Is there a way to accomplish this without creating a Style? Creating a Style won't work, as Styles include other settings for all those other tabs—Font, Font Effects, Alignment, Borders, Background, and Cell Protection—that vary for cells where the modified Number Format: Decimal format is desired. I'd also prefer not to use a macro, but fear that is the only solution.
Is there a way to modify the built-in setting, or an option other than creating a Style or a macro?
Thanks!
[Solved] Is it possible to modify a built-in number format?
[Solved] Is it possible to modify a built-in number format?
Last edited by ChasVA on Sat Dec 30, 2017 6:38 am, edited 2 times in total.
Version: OpenOffice 4.1.5
OS: Win 8.1 64-bit
Never try to second-guess the clueless. Malcolm Gordon
OS: Win 8.1 64-bit
Never try to second-guess the clueless. Malcolm Gordon
Re: Is it possible to modify a built-in number format?
Well, seeing as how you don't want to create a macro, you're probably not going to like the only other option that I was able to think of.... namely re-coding the part of the Calc application that controls that information.
So, technically, yes there is another option. Imo, it's not a reasonable option considering you don't want to use a macro.
So, technically, yes there is another option. Imo, it's not a reasonable option considering you don't want to use a macro.
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.
Re: Is it possible to modify a built-in number format?
Study and use the Styles. The Styles are MOST VALUABLE features of the AOO and LO.Is there a way to accomplish this without creating a Style? Creating a Style won't work, as Styles include other settings for all those other tabs—Font, Font Effects, Alignment, Borders, Background, and Cell Protection—that vary for cells where the modified Number Format:
Decimal format is desired. I'd also prefer not to use a macro, but fear that is the only solution.
Is there a way to modify the built-in setting, or an option other than creating a Style or a macro?
You can organize the Styles into a hierarhical structure. The Child Styles will inherit the properties from the Parent Style. And then you must modify only the desired property of the Child Style.
And yes, write (or record) a macro is the another possible solution.
But you need study and use the API functions and one of the supported programming languages for writing a macro. A macro can modify all of the properties (manual/direct properties and/or the properties of the applied style) of a selected cell. You can assign your macro to a toolbar entry, but you must choose one of the built-in icons for the toolbar. (Or you can/must draw and embed your own icons for the new functions...)
Using the Styles seems a simplier way for you.
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.
Re: Is it possible to modify a built-in number format?
Styles may contain partial settings. If you open the "Modify Style" dialog window and look at the "Organizer" tab, it shows a list of all the settings contained in the style. Settings that are not in the style will come from the style shown in the "linked with" field there.ChasVA wrote:... Styles include other settings for all those other tabs ...
Removing settings from a style can be done using the "Standard" button at the bottom of the dialog.
As to your question, I think others have answered, but as far as I know, the built-in formats are hard-wired. I don't know how (or if) they can be customized, even if you do use a style. The only way I know of to get a custom number format on a toolbar button is to record or write a macro that applies the formatting, either directly or by applying a named style.
AOO4/LO5 • Linux • Fedora 23
Re: Is it possible to modify a built-in number format?
Closing parenthesis and space are not the same width in every font. To ensure perfect alignment, end the format code for positive numbers with underscore + parenthesis instead of a space, like so:
#,##0.00_);[RED](#,##0.00)
I made a macro to set that format on selected cells. See attached file. That also sets USA locale for the selection (easier for me to do it that way, because my default locale is not US).
Macro recording took a minute. Another minute to add it to the toolbar with a suitable icon. If you need a well behaved macro for different locales (no locale setting from the macro), do it yourself. That also requires testing in all locales, though.
#,##0.00_);[RED](#,##0.00)
I made a macro to set that format on selected cells. See attached file. That also sets USA locale for the selection (easier for me to do it that way, because my default locale is not US).
Macro recording took a minute. Another minute to add it to the toolbar with a suitable icon. If you need a well behaved macro for different locales (no locale setting from the macro), do it yourself. That also requires testing in all locales, though.
- Attachments
-
- decimalformat.ods
- (10.94 KiB) Downloaded 86 times