Calculated Fields (Is it possible?)

5 posts by 3 authors in: Forums > CMS Builder
Last Post: October 5, 2008   (RSS)

By jamtc - October 3, 2008

Hi there!

I want to do some like this...
  1. Field3 = Field1 + Field2 or;
  2. Field3 = (Field1 * Field2) / 4


Then I'll disable Field3 for access because it is an (Automatic Calculated FIELD)

Is it possible ?

Many thanks...
[pirate]

Re: [jamtc] Calculated Fields (Is it possible?)

By Dave - October 3, 2008

It's not possible in the admin program, but possible in the viewer pages. What did you want that for and where did you want to display it?
Dave Edis - Senior Developer
interactivetools.com

Re: [jamtc] Calculated Fields (Is it possible?)

By Kenny - October 3, 2008 - edited: October 3, 2008


Here is some simple math for you:

Get one field to auto add itself to another field

<?php echo number_format($record['number1'] + $record['number2']) ?>


Get one field to auto add itself to a fixed number

<?php echo number_format($record['number'] +500 ) ?>

Get one field to auto multiply itself to a fixed number and show two zeros after the decimal place

<?php echo number_format($record['number'] * 5, 2) ?>

The ", 2" tells it to always show 2 decimals. This will also add thousands separators. So one million will display like this: 1,000,000.00


Get the idea? Post back if there is one that you can't figure out based on this information.


Kenny

Re: [sagentic] Calculated Fields (Is it possible?)

By jamtc - October 5, 2008 - edited: October 5, 2008

Ok!

I got the idea...

Many thanks...

[;)]