I think you can do what you need with Conditional Formatting.

It will not actually truncate the values to 0 decimals, but you should be able to format them to display only 2 decimals.

You need to create a named Cell Format for each display type, then use Conditional Formatting to set the desired format based on cell value.


On 4/14/25 23:21, mike.junk...@att.net wrote:
     Where do I fnd documentation of range.createReplaceDescriptor?
Hopefully that will cover how the descriptor works.
     In a spreadsheet tracking stock prices I'm currently indexing through
columns setting number formats at 2 decimals if less than $100 and 0
decimals if larger. It works but is slow. Reading through Pitonyak's
OOME again I noticed his example of a replaceDescriptor changing text
     I'd like to use it for changing number formats if possible.
Another task I do walking through a range of figures is to color cell
number red if it is less thsn yesterday's quote.
     If search returns a range and replace will work on that range
I think things would go much faster.
     A second but related question is the docs on
range.createSearchDescriptor.
Thanks,
Mike
--
How much is foreign government agitprop driving conspiracy theories
and anti-vaccine conversations?
     -MM


--
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy

Reply via email to