File tree Expand file tree Collapse file tree 3 files changed +7
-0
lines changed Expand file tree Collapse file tree 3 files changed +7
-0
lines changed Original file line number Diff line number Diff line change 11ArduinoJson: change log
22=======================
33
4+ HEAD
5+ ----
6+
7+ * Fix conversion from static string to number
8+
49v7.3.0 (2024-12-29)
510------
611
Original file line number Diff line number Diff line change @@ -183,6 +183,7 @@ TEST_CASE("JsonVariant::as()") {
183183 variant.set (" 42" );
184184
185185 REQUIRE (variant.as <long >() == 42L );
186+ REQUIRE (variant.as <double >() == 42 );
186187 REQUIRE (variant.as <JsonString>() == " 42" );
187188 REQUIRE (variant.as <JsonString>().isStatic () == true );
188189 }
Original file line number Diff line number Diff line change @@ -199,6 +199,7 @@ class VariantData {
199199 return static_cast <T>(extension->asInt64 );
200200#endif
201201 case VariantType::LinkedString:
202+ return parseNumber<T>(content_.asLinkedString );
202203 case VariantType::OwnedString:
203204 return parseNumber<T>(content_.asOwnedString ->data );
204205 case VariantType::Float:
You can’t perform that action at this time.
0 commit comments