There's a way to add a given currency?

Hi,

I would like to make some balances and calc do not have bitcoin as a currency. So there’s any way for me to add it in calc’s currencys list?

Hello Daanik, yes it is possible to add your own currency format to your “Number Formats” in Calc.

If you select the menu “Format : Cells…” (tab Numbers), there in the editfield called “Format Code” you could write for example the following code for Bitcoin currency values:

[$BTC-001] #.##0,00000000;[RED][$BTC-001] -#.##0,00000000

Then click on the green checkmark button to save it.

NB. please note that the above example uses the dot as thousands-separator, and the comma as decimal separator. It might be different for another locale.

An unsolicited remark: The widespread way of displaying “currency” is a misguidance concerning the informatiomn.available as data. You keep a format property of no more informational content as a “light gray background” as if it codes for the very relevant currency information. 1USD = 1INR this way.
Better: Explicate the currency in the column header or use an extra column for it.

(There is no way based on standard functions to ask a cell for the currency.applied to its value.)

One could ask the cell for the NumberFormat applied to it, e.g.

NF = ThisComponent.getNumberFormats().getByKey( oCell.NumberFormat )

and then look at the values of NF.CurrencySymbol, NF.CurrencyExtension, NF.CurrencyAbbreviation

Of course, there are means to get the information via the api. “…no way based on standard functions…” was supposed to include “…of Calc”. Methods of api objects were not included.
(There should be some posts concerning user functions for cell introspection. One of the disadvantages is the problem of passing the information what cell should be looked in. No way to get zjis done by a standard reference like A$1 which always results in a dereferenced ‘Double’ or 'String or a ‘DataArray’.)

Thanks man, it was useful.