Leading zero before decimal point breaks comparision

Support MB Conditional Logic Leading zero before decimal point breaks comparision

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #42785
    JackkyJackky
    Participant

    Hi! Here is the code:

    
    [
    	'name'             => 'Price',
    	'id'               => 'price',
    	'type'             => 'number',
    	'min'              => .01,
    	'step'             => .01,
    ],
    [
    	'name'             => 'Currency',
    	'id'               => 'currency',
    	'type'             => 'text',
    	'pattern'          => '[A-Z]{3}',
    	'visible'          => ['price', '!=', 0],
    	// OR 'visible'          => ['price', '!=', '0'],
    	// OR 'visible'          => ['price', '!=', ''],
    	// OR 'visible'          => ['price', '>', 0],
    	// OR 'visible'          => ['price', 'match', '^(?=.*[1-9])\d*(?:\.\d*)?$'],
    ],
    

    All of this conditions won't work when value with leading zero before point e.g. "0.1, 0.04...", but when changing to even ".1, .04 or (weird) 001" comparision starts working fine.

    #42786
    JackkyJackky
    Participant

    Should notice: it's the latest version of MetaBox it self (5.7.4) and Conditional Logic plugin (1.6.19)

    #42788
    PeterPeter
    Moderator

    Hello,

    Thanks for your feedback.

    I've escalated this issue to the development team to fix it. I will let you know when I have any information.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.