Formatting custom property number fields

When I add a custom property of the type Date in Writer I get, when I want to insert this property as a field a list of Date formats to choose from. Not so with Custom properties of the type Number. Why is this so and/or how can I format numbers with different decimal and thousands delimiters? Thanks for your help.

This looks like a limitation inherent to the concept of “property”. Properties are a set of “simple” data to be inserted in text, such as project name, revision number, date of writing, …

As such, values are inserted as raw data without editing possibilities except for dates. I think dates are allowed to be edited because there is a huge number of ways for writing dates even in a single language (which can be shared by several countries with different cultural habits).

You can record your property numbers as text if all insertions should display the same.

If you really need to alter the number rendering over occurrences, store it in a variable instead of a property. It is more tricky and less elegant because you need to create a document “preface” where you stuff your configuration variables and assign them a dedicated paragraph style with Hidden attribute so that it doesn’t show up in the final printed form. Format for inserted variables can be adjusted occurrence by occurrence.

1 Like

@ ajlittoz Thanks for your help.

In addition:
Writer is “supporting” number formats for TextTable cells and for some types of TextField items.
However, this support isn’t well satisfying, IMO. From my experience I would judge that a custom format created for one TextField of type ‘User Field’ (e.g.) will not also be offered for the creation or when editing a different TextField of the same type.
Most recent test with V 7.3.1.3.

Are previously defined custom formats offered to you as should be expected?

Quite honestly I have used only Calc until today so I have no previously defined custom formats of numbers in Writer as of now. If I get you right I have to use a table in writer to format numbers, right?

There is a misunderstanding. Also in Calc the number formats aren’t managed for the document type, but per document. Same thing with Writer documents. Only the defaults (predefined formats) come from the application. (Don’t know the details.)

Years ago I spent some hours to get a couple of routines allowing for “harmonizing” TextField objects of types date, time, and date-time. The intention was mainly to help users to get rid of specifically silly formats widely spread in this field. The routines worked, my intentions were in vain, of course.

Today when I read your question, I made a short test assuming the same technique would allow to re-format numeric user-fields. It failed, and I don’t know (didn’t spend another few hours to find out) for what reason: If I assign a different NumberFormat key to such a TextField, the format doesn’t get updated automatically for the display.

I don’t remember every detail of the mentioned attempts from years ago. If you are interested in own research concerning possible solutions based on user code, you can get my most recent example file, of course.

===
Just tried again. Now the assignment of a different NumberFormat key updated the representation as expected. Couldn’t find the error I made earlier this day.

Dear Lupp,

that’s very nice of you, thanks for all your efforts. To be honest the makeshift solution of entering the numbers as textstrings exactly the way I want them to appear in the text works for now and I will keep it until I will change to a more professional way and merge cells from a calc spreadsheet into the writer document. I am sure I will turn to you if I will hit a wall.
Best regards
Urs