Supported Formulas
Methvin supports various functions, enabling you to perform calculations with ease and accuracy. Whether you're managing complex construction projects or performing simple measurements, these functions are designed to simplify your workflow and ensure precise results. Different types of functions available are quick arithmetic, advanced JavaScript-based calculations, as well as date functions that assist in managing project durations.
Quick Functions
- [SGS]: Represents the specific gravity of steel, set at 8050.
- [PI]: Ratio of a circle's circumference to its diameter, approximately 3.14159.
- Global Variable Usage: Allows you to use a global variable consistently throughout your project.
Example: 1 + [ABC]
- Power Calculation: Computes the power of a number.
Example: 2^2 calculates 2 to the power of 2
- Square Root: Computes the square root of a number.
Example: 2^(1/2) calculates the square root of 2, approximately 1.414
- Conditional Statements: Provides logic-based outcomes based on conditions.
Example: if(10>5) {55} else {66}
- [qty]: Returns the Bill Item Quantity, changing this will affect the total quantity.
JavaScript Math Functions
These functions utilize JavaScript to perform more advanced mathematical calculations.
- Math.E: Euler’s constant, approximately 2.718.
- Math.LN(): Natural logarithm
Example: Math.LN(2) Natural logarithm of 2, approximately 0.693
- Math.log(): Natural logarithm of a number.
Example: Math.log(2)
- Math.LOG()E: Example: Base 2 logarithm of E, approximately 1.443.
- [PI] or Math.PI: The mathematical constant π, approximately 3.14159.
- Math.ceil(): Rounds a number up to the nearest integer.
Example: Math.ceil(2.1)will round up to 3
- Math.floor(): Rounds a number down to the nearest integer.
Example: Math.floor(2.9)will round down to 2
- Math.min(): Returns the smallest value in a list of arguments.
Example: Math.min(0, 150, 30, -200, -8, -200) will give -200
- Math.max(): Returns the largest value in a list of arguments.
Example: Math.max(0, 150, 30, 20, -8, -200) will give 150
- Math.SQRT(x): Square root of number.
Example: Math.SQRT(2) Square root of 2, approximately 1.414
- Math.round(x) - Rounds a number.
- x.toFixed(2) - Rounds a number to two decimal places.
- Math.sin(x) - Calculates the sine value.
JavaScript Date Functions - Contract Duration & Variables
Date calculations can also be performed using appropriate syntax. These functions help manage contract-related calculations based on dates.
- Contract Start Date: Define the start date for the contract.
Example: SD1 is 10/01/2017
- Contract End Date: Define the end date for the contract.
Example: ED1 is 24/05/2017
- Contract Duration: Calculate the duration of the contract.
Example: CD1 = (([ED1]-[SD1])/1000/60/60/24/365.242*12*4.33).toFixed(2) will make the final duration 19.07 weeks