dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #12593
Re: [Branch ~dhis2-devs-core/dhis2/trunk] Rev 3903: Applied patch from Hieu. 1. Changes the data element value types to number, integer, positive int...
Dear Jason,
How do you feel if we combine isNumber and isRealNumber to be one only? But
with the modified regex value as below:
This is your patch : var regex = /^(0(?:\.0*)?|[-]?[1-9]\d*\.?[0-9]*)$/;
This is my modified : var regex = /^(0(?:\.0*)?|[-]?[1-9]\d*\.?[0-9].+)$/;
One more thing, perhaps, you forget to place this isValidZeroNumber to some
where ;) please review then let me know.
Thank you.
2011/6/15 Jason Pickering <jason.p.pickering@xxxxxxxxx>
>
> Dear Lars and Hieu,
>
>
> I would like to suggest a few more improvements to this commit. Please find
> attached a suggested patch.
>
> One thing I am a little unsure of is how to handle the situation when the
> number is a zero and should be stored.
>
> The problem is here..
>
> return isNumber( value ) && parseFloat( value ) == 0;
>
> if the value is 000.0000 parseFloat will return 0, but isNumber (with the
> patch) will not allow multiple leading zeros. Not too sure about this
> one...
>
> Let me know what you think.
>
> Best regards,
> Jason
>
>
>
> On Wed, Jun 15, 2011 at 4:28 AM, Hieu Dang Duy <hieu.hispvietnam@xxxxxxxxx
> > wrote:
>
>> Thanks to Jason for providing in nice regex :)
>>
>>
>> On Tue, Jun 14, 2011 at 11:39 PM, jason.p.pickering@xxxxxxxxx <
>> jason.p.pickering@xxxxxxxxx> wrote:
>>
>>> Thanks for this. :-)
>>>
>>> Sent from my HTC
>>>
>>>
>>>
>> --
>> Good heath !
>>
>>
>
--
Good heath !
Follow ups
References