diff --git a/modules/stream_manager/help/en_US/xml/fprintf.xml b/modules/stream_manager/help/en_US/xml/fprintf.xml
index e9e7630393..30f0e5b140 100644
--- a/modules/stream_manager/help/en_US/xml/fprintf.xml
+++ b/modules/stream_manager/help/en_US/xml/fprintf.xml
@@ -136,6 +136,8 @@
+ To display a percent sign, you need to use a double percent sign (%%) in the format string.
@@ -183,6 +185,13 @@ end
+
+ nelson
+ Display a percent sign
+
+
+
+
diff --git a/modules/stream_manager/src/cpp/PrintfFunction.cpp b/modules/stream_manager/src/cpp/PrintfFunction.cpp
index 2c20d83702..5f0ac67491 100644
--- a/modules/stream_manager/src/cpp/PrintfFunction.cpp
+++ b/modules/stream_manager/src/cpp/PrintfFunction.cpp
@@ -90,6 +90,7 @@ printfFunction(const ArrayOfVector& args, std::wstring& errorMessage, std::wstri
if (*(dp + 1) == L'\0') {
return true;
}
+ dp += 2;
}
if (*dp == L'%' && *(dp + 1)) {
np = PrintfHelper::validateFormatSpec(dp + 1);
diff --git a/modules/stream_manager/tests/test_fprintf.m b/modules/stream_manager/tests/test_fprintf.m
index 8607abdf36..94ac465bd2 100644
--- a/modules/stream_manager/tests/test_fprintf.m
+++ b/modules/stream_manager/tests/test_fprintf.m
@@ -51,3 +51,7 @@
assert_istrue(iscellstr(ce));
assert_istrue(any(contains(ce, 'windows-1251')));
%=============================================================================
+R = evalc('fprintf(1,''%d%%.'',50)')
+REF = '50%.';
+assert_isequal(R, REF);
+%=============================================================================
\ No newline at end of file
diff --git a/modules/string/help/en_US/xml/sprintf.xml b/modules/string/help/en_US/xml/sprintf.xml
index 42515787cf..c1808ca1f7 100644
--- a/modules/string/help/en_US/xml/sprintf.xml
+++ b/modules/string/help/en_US/xml/sprintf.xml
@@ -117,7 +117,8 @@
Character vector. |
-
+ To display a percent sign, you need to use a double percent sign (%%) in the format string.
@@ -146,10 +147,14 @@
-
-
+
+ nelson
+ Display a percent sign
+
+
+
diff --git a/modules/string/tests/test_sprintf.m b/modules/string/tests/test_sprintf.m
index 491301e724..7f317cc452 100644
--- a/modules/string/tests/test_sprintf.m
+++ b/modules/string/tests/test_sprintf.m
@@ -200,3 +200,7 @@
REF = '20 %.';
assert_isequal(R, REF);
%=============================================================================
+R = sprintf('%d%%.',50);
+REF = '50%.';
+assert_isequal(R, REF);
+%=============================================================================
\ No newline at end of file