user85818: so I have a problem with displaying a double variable in OLED & IR remote calculator, like this (using u8g2):
displayTextOnRight(String(100000, 0)); //ex. of an void and a number

It displays: " "
But when I set to ex. 99999 it displays: "99999"
The same is with
displayTextOnRight(String(1000.00, 2)); 

It also displays nothing. (100.00 displays 100.00)
I tried values below zero and it crashes. When I try 6 it's empty whatever I type on my remote.
Please help.

user70020: When the first argument to the String constructor is an integer type, it tries to interpret the second argument as a number base and not as a number of decimal places.
So, in String(100000, 0));, it kind of thinks you're asking for the number to represented in the String in base 0 as opposed to decimal (DEC), hexadecimal (HEX), binary (BIN), etc and base 0 isn't a thing.
With a floating point type first argument like 1000.0 the second argument takes on the meaning of decimal places (seen an decimalPlaces in the documentation).
If you want ".00" after an integer number when it's converted to a String it's probably better to just print it in a second .print() call, or to concatenate it to the string. And if you want you can manually type convert integer expressions to floating point type to force selection of the other constructor, e.g. int a = 10000; whatever.print(String(float(a), 2));

85818: <p>so I have a problem with displaying a double variable in OLED &amp; IR remote calculator, like this (using u8g2):</p>
<pre><code>displayTextOnRight(String(100000, 0)); //ex. of an void and a number
</code></pre>
<p>It displays: &quot; &quot;
But when I set to ex. 99999 it displays: &quot;99999&quot;</p>
<p>The same is with</p>
<pre><code>displayTextOnRight(String(1000.00, 2)); 
</code></pre>
<p>It also displays nothing. (100.00 displays 100.00)</p>
<p>I tried values below zero and it crashes. When I try 6 it's empty whatever I type on my remote.</p>
<p>Please help.</p>
 70020: <p>When the first argument to the <a href="https://www.arduino.cc/reference/en/language/variables/data-types/stringobject/" rel="nofollow noreferrer">String</a> constructor is an integer type, it tries to interpret the second argument as a number base and not as a number of decimal places.</p>
<p>So, in <code>String(100000, 0));</code>, it kind of thinks you're asking for the number to represented in the <code>String</code> in base 0 as opposed to decimal (<code>DEC</code>), hexadecimal (<code>HEX</code>), binary (<code>BIN</code>), etc and base 0 isn't a thing.</p>
<p>With a floating point type first argument like <code>1000.0</code> the second argument takes on the meaning of decimal places (seen an <code>decimalPlaces</code> in the documentation).</p>
<p>If you want <code>&quot;.00&quot;</code> after an integer number when it's converted to a String it's probably better to just print it in a second <code>.print()</code> call, or to concatenate it to the string. And if you want you can manually type convert integer expressions to floating point type to force selection of the other constructor, e.g. <code>int a = 10000; whatever.print(String(float(a), 2));</code></p>
