summaryrefslogtreecommitdiff
path: root/2.3-1/macros/GeneralFunctions/SCI2Cstring.sci
diff options
context:
space:
mode:
authorSandeep Gupta2017-06-18 23:55:40 +0530
committerSandeep Gupta2017-06-18 23:55:40 +0530
commitb43eccd4cffed5bd1017c5821524fb6e49202f78 (patch)
tree4c53d798252cbeae9bcf7dc9604524b20bb10f27 /2.3-1/macros/GeneralFunctions/SCI2Cstring.sci
downloadScilab2C-b43eccd4cffed5bd1017c5821524fb6e49202f78.tar.gz
Scilab2C-b43eccd4cffed5bd1017c5821524fb6e49202f78.tar.bz2
Scilab2C-b43eccd4cffed5bd1017c5821524fb6e49202f78.zip
First commit
Diffstat (limited to '2.3-1/macros/GeneralFunctions/SCI2Cstring.sci')
-rw-r--r--2.3-1/macros/GeneralFunctions/SCI2Cstring.sci34
1 files changed, 34 insertions, 0 deletions
diff --git a/2.3-1/macros/GeneralFunctions/SCI2Cstring.sci b/2.3-1/macros/GeneralFunctions/SCI2Cstring.sci
new file mode 100644
index 00000000..cf6d4370
--- /dev/null
+++ b/2.3-1/macros/GeneralFunctions/SCI2Cstring.sci
@@ -0,0 +1,34 @@
+function outstring = SCI2Cstring(innum)
+// function outstring = SCI2Cstring(innum)
+// -----------------------------------------------------------------
+// #RNU_RES_B
+// It fixes the bug of string function when applied to
+// exponential formats:
+// Example:
+// -->string(10e-10)
+// ans =
+// 1.000D-09
+// Note how the "D" is syntactically wrong.
+//
+// Input data:
+// innnum: input number to be converted into string.
+//
+// Output data:
+// outstring: string containing the conversion.
+// #RNU_RES_E
+//
+// Status:
+// 07-May-2008 -- Nutricato Raffaele: Author.
+//
+// Copyright 2008 Raffaele Nutricato.
+// Contact: raffaele.nutricato@tiscali.it
+// -----------------------------------------------------------------
+
+// ------------------------------
+// --- Check input arguments. ---
+// ------------------------------
+SCI2CNInArgCheck(argn(2),1,1);
+
+outstring=strsubst(string(innum),'D','e');
+
+endfunction