Skip to content

Commit 0552ca3

Browse files
NumConv docs
1 parent 2faf39a commit 0552ca3

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

SerialX-core/src/main/java/org/ugp/serialx/converters/NumberConverter.java

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,29 @@ <td>new Integer(255)</td>
6363
<td>0b1111</td>
6464
<td>new Integer(15)</td>
6565
</tr>
66+
<tr>
67+
<td>0112</td>
68+
<td>new Integer(74)</td>
69+
</tr>
70+
<tr>
71+
<td>0112</td>
72+
<td>new Integer(74)</td>
73+
</tr>
74+
<tr>
75+
<td>10e2</td>
76+
<td>new Integer(10e2)</td>
77+
</tr>
78+
<tr>
79+
<td>10e2</td>
80+
<td>new Integer(10e2)</td>
81+
</tr>
82+
<tr>
83+
<td>.1e2</td>
84+
<td>new Double(0.1e2)</td>
85+
</tr>
6686
</table>
6787
*
68-
* @see NumberConverter#numberOf(CharSequence, char, int, int)
88+
* @see NumberConverter#numberOf(CharSequence, char, int, int, int)
6989
*
7090
* @author PETO
7191
*
@@ -151,7 +171,8 @@ public String format(Number num)
151171
* Note that floating point numberer will be treated as {@link Double} if no suffix is present by default. Also numbers in E-notation format with negative exponents can be converted to {@link Double}. Further more, integers will be auto-converted to {@link Long} if overflow should occur!<br>
152172
* Important thing to know is that this argument will be overridden by suffix from str if present!
153173
*
154-
* @return
174+
* @return {@link Number} parsed from str with rules specified above. This function was designed to act as more optimized merger of {@link Byte#valueOf(String, int)}, {@link Short#valueOf(String, int)}, {@link Integer#valueOf(String, int)}, {@link Long#valueOf(String, int)} and {@link Float#valueOf(String)}, {@link Double#valueOf(String)} all encapsulated in 1 universal function.<br>
175+
* Note: This function will not check for incorrect number formats in order to save performance. Only incorrect format is when inserted string contains space, in this case it will return null!
155176
*
156177
* @since 1.3.7
157178
*/

0 commit comments

Comments
 (0)