I'm using Benjamin's slider module to scrub through a price range. How do I keep the comma in the thousandths position? As soon as I slide, the comma is removed.
RegEx is fun...BUT...It's a black art that even Software Engineers will shy away from...https://framer.cloud/rvacf
This is more than 1 line of code, but much easier to understand and explain to someone (read fellow designers). The gist of it is divide by 1000 to get the number part that's GREATER THAN 1000 and then use '%' which is the modulus operator to get the remainder... So the number part that's LESS THAN 1000. One quirk is that you have to zeroPad on the left of the hundreds part, but that's a very simple string manipulation. " zeroPadHundreds = ('0000'+hundreds).slice(-3);"
In my experience, regex is also a pretty heavy and slow function, so if you were building something big doing a lot of regex string manipulation can have a big negative impact on performance.
Working on some similar stuff as well. Still WIP but I have also managed to add $250 increments: https://framer.cloud/kObdH
Interesting that you use Framer for prototyping (?) at Facebook.