Bug / unexpected behavior with leading zeros - number / string widget
See original GitHub issueBig bug on my side.
I wanna have a color picker / HEX sort of thing. Right now it’s just numbers, but if I have a HEX code that starts with zeros, the end result is wrong.
008000
generates 8000
. Help.
https://github.com/cstate/cstate/issues/83
If I try and enter "008000"
, there’s double quotes which confuse Hugo. In turn, the color HEX becomes #ZgotmplZ
.
Is there something I can do to prevent the assumption that I don’t need the first two zeros?
Issue Analytics
- State:
- Created 4 years ago
- Comments:12 (9 by maintainers)
Top Results From Across the Web
String example fields are incorrectly converted to numbers ...
String example values with leading zeros are treated as numbers, with quotes being stripped during bundling, resulting in failing schema ...
Read more >Leading zeros are not allowed in Python? - Stack Overflow
Integer literals starting with 0 are illegal in python (other than zero itself, obviously), because of ambiguity.
Read more >How to Fix You have Been Kicked Due Unexpected Client ...
How to Fix You have Been Kicked Due Unexpected Client Behavior Roblox Exploiting Error Code 268!!
Read more >Bug listing with status RESOLVED with resolution FIXED as at ...
Bug :2 - "How do I attach an ebuild." status:RESOLVED resolution:FIXED severity:normal · Bug:3 - "poedit-1.1.5.ebuild" status:RESOLVED resolution:FIXED ...
Read more >EZYXxxxx messages - IBM
XmNmustMatch is always False for a Command widget. EZYXM26W XmNhistoryMaxItems must be a positive integer greater than zero.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The CMS isn’t removing the zeros. I would expect the double quotes to be from quotes being manually added to the string input.
Sent with GitHawk
The source shows zeroes, but any yaml -> json converters I can find drop the leading zeroes if quotes are not present. That said, I think I found my final recommendation: include the leading hash. A hex code is supposed to begin with a hash to be valid, and doing so ensures leading zeroes never drop. I’d recommend storing hashes in your raw values.