Tap Forms Database Pro for Mac, iPhone, iPad and Apple Watch › Forums › Using Tap Forms 5 › Calculation Field: Trigonometric and Math Functions
- This topic has 3 replies, 2 voices, and was last updated 11 years, 4 months ago by
Brendan.
-
AuthorPosts
-
June 11, 2014 at 8:27 PM #10360
1LeviteParticipantI thought I recalled seeing a list of functions that could be used in the calculation field (other than the basic four: +, -, /, x), but I can’t seem to find it now. Here’s a short observation on more interesting calculations.
I found that the following functions seem to work great:
SIN(fieldname) where fieldname is a Numeric field.
COS(fieldname)
TAN(fieldname)
LOG(fieldname) [although couldn’t figure out natural log]
SQRT(fieldname) for square root
PI may be used in calculations as PI
If you are using SIN(), COS(), TAN(), be aware that fieldname must be in radians (or be converted from degrees to radians in the calculation by multiplying degrees by PI/180).The default for calculation fields seems to be zero decimal places–remember to assign the desired number of decimal values.
The calculation field offers more than I originally thought. Very nifty–if you need that sort of thing.
June 13, 2014 at 12:21 AM #10367
BrendanKeymasterI didn’t publish these extra math functions because I wanted to have a better math parser than what I have now. Plus you can’t enter that stuff on the iOS version. But they should work fine nonetheless.
Good sleuthing though!
Thanks!
Brendan
June 14, 2014 at 11:23 AM #10380
1LeviteParticipantOne more: Raising to powers in the TF OSX calculation field.(TF 2.2.3)
[fieldname]^3 in the calculation field will give you the cube of fieldname.
If you have two separate numeric fields, the following works too:
[fieldname1]^[fieldname2] returns fieldname1 raised to the power of fieldname2
June 14, 2014 at 11:32 AM #10382
BrendanKeymasterIf you want to see the original source of the math library I’m using, you can find it here:
But I’m hoping to change to this parser at some point:
It has some interesting features. I’m also hoping to modify the parser to support string concatenation. So you could do “Total: ” + Cost * 1.05 + ” owed”. Or even simply First Name + ” ” + Last Name.
Thanks!
Brendan
-
AuthorPosts
You must be logged in to reply to this topic.