Forum

Thread tagged as: Question, Field-Types

Math between two variables

I'm fairly new to Perch and was looking for a way to perform simple math (addition, subtraction, division, and multiplication) on two variables, but I'm not finding it. Is this possible or is this something that can be done with a field type?

Steve Dobkins

Steve Dobkins 0 points

  • 5 years ago

I'm fairly certain this can't be done with stock Perch. Depending on the use case, you'd probably be best off doing this with PHP. What are you trying to do?

Thanks for the quick reply.

I'm trying to take a piece of content, which would be a number, and multiply it by a different piece of content, which would also be a number. But I've been looking and I think you're right.

It's something I can probably work around.

Rachel Andrew

Rachel Andrew 394 points
Perch Support

You could write a custom field type to do this.

https://docs.grabaperch.com/api/field-types/