From 47466a487392c6409cbc15f947e3c4d7e829d16c Mon Sep 17 00:00:00 2001 From: kevin Date: Fri, 29 Nov 2024 13:15:02 -0500 Subject: [PATCH] cwNumericConvert.cpp, Makefile.am : Initial commit. --- Makefile.am | 2 +- cwNumericConvert.cpp | 30 ++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 cwNumericConvert.cpp diff --git a/Makefile.am b/Makefile.am index df15925..051ecf2 100644 --- a/Makefile.am +++ b/Makefile.am @@ -11,7 +11,7 @@ libcwHDR += src/libcw/cwB23Tree.h libcwSRC += src/libcw/cwB23Tree.cpp libcwHDR += src/libcw/cwFileSys.h src/libcw/cwText.h src/libcw/cwFile.h src/libcw/cwTime.h src/libcw/cwLex.h src/libcw/cwNumericConvert.h -libcwSRC += src/libcw/cwFileSys.cpp src/libcw/cwText.cpp src/libcw/cwFile.cpp src/libcw/cwTime.cpp src/libcw/cwLex.cpp +libcwSRC += src/libcw/cwFileSys.cpp src/libcw/cwText.cpp src/libcw/cwFile.cpp src/libcw/cwTime.cpp src/libcw/cwLex.cpp src/libcw/cwNumericConvert.cpp libcwHDR += src/libcw/cwLib.h src/libcw/cwCsv.h libcwSRC += src/libcw/cwLib.cpp src/libcw/cwCsv.cpp diff --git a/cwNumericConvert.cpp b/cwNumericConvert.cpp new file mode 100644 index 0000000..9fa09b6 --- /dev/null +++ b/cwNumericConvert.cpp @@ -0,0 +1,30 @@ +#include "cwCommon.h" +#include "cwLog.h" +#include "cwCommonImpl.h" +#include "cwMem.h" +#include "cwFile.h" +#include "cwTest.h" +#include "cwLex.h" +#include "cwText.h" +#include "cwTest.h" +#include "cwNumericConvert.h" + + +cw::rc_t cw::numericConvertTest( const test::test_args_t& args ) +{ + int8_t x0 = 3; + int x1 = 127; + + cw::numeric_convert( x1, x0 ); + cwLogPrint("%i %i\n",x0,x1); + + + int v0 = -1; + double v1 = -1; + cw::string_to_number("123",v0); + cw::string_to_number("3.4",v1); + cwLogPrint("%i %f\n",v0,v1 ); + + return cw::kOkRC; +} +