Ask Your Question
1

Currency formatting not being applied to cell with user defined basic formula. [closed]

asked 2017-01-26 20:08:02 +0100

krafczyk gravatar image

updated 2020-09-21 23:30:46 +0100

Alex Kemp gravatar image

Currency formatting is not applied to calc cells which contain user defined formulas that return 'Currency' values.

For example, if you create the following basic function:

Function TestFunc() As Currency
    Dim Result As Currency
    Result = 5.50
    TestFunc = Result
End Function

Then use that function in a cell like =TestFunc(), the value '5.5000' appears in the cell.

If I try to enforce the typical currency style by selecting the cell and going to 'Format' 'Cells..' And then double clicking the currency format I want, nothing happens. '5.5000' continues to be displayed even though '$5.50' ought to be displayed.

In addition, If you create several such cells and then try to sum over them with the =SUM function, the value is always '$0.00'.

Any ideas why this is happening?

I'm currently using libreoffice 5.2.4.0 on Arch linux.

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Alex Kemp
close date 2020-09-21 23:31:02.032205

1 Answer

Sort by » oldest newest most voted
1

answered 2017-01-26 21:11:04 +0100

erAck gravatar image

The BASIC Currency return type is not recognized as number but string instead, which seems to be a bug. To workaround, do not define it as Currency but return a normal number instead.

edit flag offensive delete link more

Comments

Submitted bug tdf#105558

erAck gravatar imageerAck ( 2017-01-26 21:20:18 +0100 )edit

For the records, fixed for 5.3.1 and 5.4.0.

erAck gravatar imageerAck ( 2020-09-22 22:21:08 +0100 )edit

Question Tools

1 follower

Stats

Asked: 2017-01-26 20:08:02 +0100

Seen: 439 times

Last updated: Jan 26 '17