Bug 39900 - Feature enhancement: Frac()
Summary: Feature enhancement: Frac()
Status: CLOSED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: BASIC (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Not Assigned
QA Contact:
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:
i915 platform:
i915 features:


Attachments

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!


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.