Firefox 38 parseFloat behaviour

UNCONFIRMED
Unassigned

Status

()

UNCONFIRMED
3 years ago
3 years ago

People

(Reporter: trebaol.gwenael, Unassigned)

Tracking

38 Branch
x86_64
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [specification][type:bug][2016-GBT-Y])

(Reporter)

Description

3 years ago
What did you do?
================
1. Used parseFloat function in an Angular Directive 

What happened?
==============
I was having some trouble with firefox 38 html5 validation popping a $error.max on an input type number. Only to realize that the parseFloat function I used in my directive was the reason of this validation error.

The function I use : parseFloat(viewValue.replace(',', '.'));

The value returned based on the input value :

10.3 : 10.3
10.32 : 10.32
10.321 : 10321
10.3211 : 10.3211

When the input value is 10.321, the parseFloat gives me back the value 10321 !! 


What should have happened?
==========================
The parseFloat function should have transform the value 10.321 into 10.321.

Is there anything else we should know?
======================================
Firefox 38, angular 1.4.6, http://pastebin.com/VEZGnZ2C
(Reporter)

Updated

3 years ago
Component: General → General
OS: Other → Linux
Product: Mozilla Developer Network → Firefox
Hardware: All → x86_64
Version: unspecified → 38 Branch
Whiteboard: [specification][type:bug] → [specification][type:bug][2016-GBT-Y]
You need to log in before you can comment on or make changes to this bug.