Summary: Truncates a numeric variable to the decimal place the user desires.
Latest Compatible Source code date: 12/23/2009
Depends on the following GMAT functions: none
Function inputs:
- Variable - number to be truncated
- Variable - decimal place to truncate to. (i.e. 0.001 is the third decimal place)
- Variable
- Code: Select all
[out1] = truncToDecPlace(in1,in2)
Examples from calling script:
- Code: Select all
% Object Creation
Create Variable in1 in2;
Create Variable out1;
% Begin Mission Sequence
BeginScript;
EndScript; % Ensures start of mission sequence in main script
in1 = 456.213145;
in2 = 0.01; % output of function should be 456.21 when using this value
[out1] = truncToDecPlace(in1,in2); % Call GMAT Function