From 3a11e5072e107b0b2001f40b64d86d8b1c044cd8 Mon Sep 17 00:00:00 2001 From: mscherer Date: Tue, 17 Mar 2026 18:00:57 +0100 Subject: [PATCH] Document Number::parseFloat() returning null on failure Refs cakephp/cakephp#19347 --- docs/en/appendices/5-4-migration-guide.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/docs/en/appendices/5-4-migration-guide.md b/docs/en/appendices/5-4-migration-guide.md index f039961a1a..e3f3d08c8a 100644 --- a/docs/en/appendices/5-4-migration-guide.md +++ b/docs/en/appendices/5-4-migration-guide.md @@ -16,7 +16,16 @@ bin/cake upgrade rector --rules cakephp54 ## Behavior Changes -- WIP +### I18n + +``Number::parseFloat()`` now returns ``null`` instead of ``0.0`` when parsing +fails. Previously, when ``NumberFormatter::parse()`` failed it returned ``false``, +which was cast to ``0.0``. This silently converted invalid input like ``"abc"`` +to ``0.0``, making it impossible to distinguish from valid ``"0"`` input. + +This also affects ``FloatType`` and ``DecimalType`` database types which use +``Number::parseFloat()`` internally. Invalid locale-formatted form input will +now result in ``null`` entity values instead of ``0``. ## Deprecations