Bug 39900 - Feature enhancement: Frac()
Summary: Feature enhancement: Frac()
Status: CLOSED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: BASIC (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: Other All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:3.5
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-07 07:49 UTC by Johnny Rosenberg
Modified: 2012-01-27 11:27 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Johnny Rosenberg 2011-08-07 07:49:58 UTC
There doesn't seem to be a Frac() function available in LibreOffice Basic, so I always have to use my own function (which is probably slower than a native one would be):

Function Frac(Value As Double) As Double
	Frac=Value-Fix(Value)
End Function

For example, Frac(-12.3456789) ⇨ -0.3456789

I use Frac() all the time and I can't be the only one who need it, can I? Among other things it's nice for separating time from time+date, even if there are other ways to do that.


FRAC() also seems to be missing as a cell function.
Comment 1 Markus Mohrhard 2011-10-21 09:22:49 UTC
In calc you can use =MOD(3.4,1)

I think there is no need to add a FRAC function and there is no function specified in openformula, so implementing it would create some problems

The basic function part is solved with this patch: http://cgit.freedesktop.org/libreoffice/core/commit/?id=556a61a2f86fef1f828b8352fae7a4c4ed1fdd78 (the commit message is misleading: it only adds the Frac function to basic not to calc)
Comment 2 Johnny Rosenberg 2012-01-27 11:27:41 UTC
Oops… I didn't think of the MOD() function (REST() in my case), I guess I should have.

Well, then there is no problem after all. Thanks!