<html>
<head>
<base href="https://bugs.documentfoundation.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_UNCONFIRMED "
title="UNCONFIRMED - Format Basic function converts string to number irrespective of format string"
href="https://bugs.documentfoundation.org/show_bug.cgi?id=143182">143182</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Format Basic function converts string to number irrespective of format string
</td>
</tr>
<tr>
<th>Product</th>
<td>LibreOffice
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Hardware</th>
<td>All
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>UNCONFIRMED
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>medium
</td>
</tr>
<tr>
<th>Component</th>
<td>BASIC
</td>
</tr>
<tr>
<th>Assignee</th>
<td>libreoffice-bugs@lists.freedesktop.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>mikekaganski@hotmail.com
</td>
</tr></table>
<p>
<div>
<pre>In LibreOffice Basic, this call returns "1":
Format("001", "@")
The format string specifies "put the text as is", but the "001" obviously gets
converted to a number before processing.
Note that Format documentation [1] is wrong where it tells "expression: Numeric
expression". In fact, this function argument is Variant, and works with input
like "Bar" as expected, without converting it to 0. (FTR: the method is
specified at [2], implemented in [3], and functionally implemented in [4].)
In VBA, the call above produces the expected "001".
[1]
<a href="https://help.libreoffice.org/7.2/en-US/text/sbasic/shared/03120301.html?DbPAR=BASIC">https://help.libreoffice.org/7.2/en-US/text/sbasic/shared/03120301.html?DbPAR=BASIC</a>
[2]
<a href="https://opengrok.libreoffice.org/xref/core/basic/source/runtime/stdobj.cxx?r=fbaf865f#389">https://opengrok.libreoffice.org/xref/core/basic/source/runtime/stdobj.cxx?r=fbaf865f#389</a>
[3]
<a href="https://opengrok.libreoffice.org/xref/core/basic/source/runtime/methods.cxx?r=4a0b40f1&fi=SbRtl_Format#SbRtl_Format">https://opengrok.libreoffice.org/xref/core/basic/source/runtime/methods.cxx?r=4a0b40f1&fi=SbRtl_Format#SbRtl_Format</a>
[4]
<a href="https://opengrok.libreoffice.org/xref/core/basic/source/sbx/sbxscan.cxx?r=0771ac00&mo=19326&fi=660#660">https://opengrok.libreoffice.org/xref/core/basic/source/sbx/sbxscan.cxx?r=0771ac00&mo=19326&fi=660#660</a></pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>