summaryrefslogtreecommitdiffstats
path: root/helpcontent2/source/text/sbasic/shared/03170020.xhp
diff options
context:
space:
mode:
Diffstat (limited to 'helpcontent2/source/text/sbasic/shared/03170020.xhp')
-rw-r--r--helpcontent2/source/text/sbasic/shared/03170020.xhp58
1 files changed, 58 insertions, 0 deletions
diff --git a/helpcontent2/source/text/sbasic/shared/03170020.xhp b/helpcontent2/source/text/sbasic/shared/03170020.xhp
new file mode 100644
index 0000000000..567b9fb5bc
--- /dev/null
+++ b/helpcontent2/source/text/sbasic/shared/03170020.xhp
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<helpdocument version="1.0">
+ <!--
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ -->
+ <meta>
+ <topic id="textsbasicshared03170020xml" indexer="include" status="PUBLISH">
+ <title id="tit" xml-lang="en-US">FormatPercent Function [VBA]</title>
+ <filename>/text/sbasic/shared/03170020.xhp</filename>
+ </topic>
+ </meta>
+ <body>
+ <section id="formatPercent">
+ <bookmark id="bm_id541542193473856" xml-lang="en-US" branch="hid/zzzz" localize="false"/>
+ <bookmark xml-lang="en-US" branch="index" id="bm_id661542193659245">
+ <bookmark_value>FormatPercent function</bookmark_value>
+ </bookmark>
+ <h1 id="hd_id871542193473857" xml-lang="en-US"><link href="text/sbasic/shared/03170020.xhp">FormatPercent [VBA]</link></h1>
+ <paragraph id="par_id351542193473858" role="paragraph" xml-lang="en-US">Returns a string with a number formatting applied to a numeric expression. A percent sign is appended to the returned string.</paragraph>
+ </section>
+ <embed href="text/sbasic/shared/00000003.xhp#vbasupport"/>
+ <embed href="text/sbasic/shared/00000003.xhp#functsyntax"/>
+ <bascode>
+ <paragraph role="bascode" id="par_id291542194090512" localize="false">FormatPercent( expression, [numDigitsAfterDecimal As Integer], [includeLeadingDigit As Integer], _</paragraph>
+ <paragraph role="bascode" id="bas_id651676032533813" localize="false"> [useParensForNegativeNumbers As Integer], [groupDigits As Integer] ) As String</paragraph>
+ </bascode>
+ <embed href="text/sbasic/shared/03170010.xhp#ReturnAndParms"/>
+ <embed href="text/sbasic/shared/00000003.xhp#errorcode"/>
+ <embed href="text/sbasic/shared/00000003.xhp#err13"/>
+ <embed href="text/sbasic/shared/00000003.xhp#functexample"/>
+ <bascode>
+ <paragraph role="bascode" id="par_id381542204697430" xml-lang="en-US" localize="false">Sub TestFormatNumber</paragraph>
+ <paragraph role="bascode" id="par_id551542204266762" localize="false"> Const UseComputerRegionalSettings = -1</paragraph>
+
+ <paragraph role="bascode" id="par_id771542204286220" xml-lang="en-US"> MsgBox FormatPercent(12.2, NumDigitsAfterDecimal:=2) ' 1220.00% if selected user interface is english</paragraph>
+
+ <paragraph role="bascode" id="par_id671542204307459" xml-lang="en-US"> MsgBox FormatPercent("-,2", 2, IncludeLeadingDigit:=vbTrue) ' -20,00% if french user interface</paragraph>
+
+ <paragraph role="bascode" id="par_id61542204328859" xml-lang="en-US"> MsgBox FormatPercent("-0.2", 2) ' -20.00% for en-US, -0,00 for fr-CA, de-AT or pt-BR</paragraph>
+
+ <paragraph role="bascode" id="par_id421542204347269" xml-lang="en-US"> MsgBox FormatPercent(-0.2, UseComputerRegionalSettings, UseParensForNegativeNumbers:=vbTrue) ' (20,00)% if pt-BR</paragraph>
+
+ <paragraph role="bascode" id="par_id151542204366706" xml-lang="en-US"> MsgBox FormatPercent("-0,2", UseComputerRegionalSettings, vbUseDefault, vbTrue) ' (20,00)% if german</paragraph>
+
+ <paragraph role="bascode" id="par_id971542204385212" xml-lang="en-US"> MsgBox FormatPercent("-12345678", -1, vbUseDefault, vbUseDefault, GroupDigits:=vbTrue) ' -1 234 567 800,00% for fr-BE</paragraph>
+
+ <paragraph role="bascode" id="par_id11542204687786" localize="false">End Sub</paragraph>
+ </bascode>
+ <section id="relatedtopics">
+ <embed href="text/sbasic/shared/00000003.xhp#VBAMath"/>
+ </section>
+</body>
+</helpdocument> \ No newline at end of file