summaryrefslogtreecommitdiff
path: root/macros/FunctionAnnotation
diff options
context:
space:
mode:
Diffstat (limited to 'macros/FunctionAnnotation')
-rw-r--r--macros/FunctionAnnotation/FA_SZ_FROM_VAL.sci26
1 files changed, 26 insertions, 0 deletions
diff --git a/macros/FunctionAnnotation/FA_SZ_FROM_VAL.sci b/macros/FunctionAnnotation/FA_SZ_FROM_VAL.sci
new file mode 100644
index 00000000..e9d88650
--- /dev/null
+++ b/macros/FunctionAnnotation/FA_SZ_FROM_VAL.sci
@@ -0,0 +1,26 @@
+function opout = FA_SZ_FROM_VAL(in1)
+// function opout = FA_SZ_FROM_VAL(in1)
+// -----------------------------------------------------------------
+// Return a size according to the floored value of the first argument
+//
+// Input data:
+// in1: string specifying a number . //
+//
+// Output data:
+// opout: string containing the computed result.
+//
+// -----------------------------------------------------------------
+
+SCI2CNInArgCheck(argn(2),1,1);
+
+in1num = eval(in1) ;
+
+if ( in1num < 0 )
+ opout= '0' ;
+else
+ opout = string ( floor (abs(in1num))) ;
+end
+
+
+
+endfunction