I have a skin that informs me about the dates of new TV series.
When I press the X2 key, it increases the episode by 1 and the day by 7.
My problem here is that if the day and section values are less than 10, I want it to add a "0" in front of them.
It needs to control 26 variables. I don't want to write separate formulas for each variable.
Could there be an easier way to do this?
A ready-made Lua script can also work for me
Use a regex substitution to add sufficient zeros before the number and then remove the surplus of zeros before the desired amount of digits you need to have for the final string, for example something like:
This is not tested, but you get the idea. You can further adjust patterns to suit your needs. Obviously, you'll then need to use the measure values where you do this, instead of the original variables (or even set the variables to the measure values, if you prefer it like that).
Yincognito wrote: ↑September 18th, 2023, 9:00 pm
Use a regex substitution to add sufficient zeros before the number and then remove the surplus of zeros before the desired amount of digits you need to have for the final string, for example something like:
This is not tested, but you get the idea. You can further adjust patterns to suit your needs. Obviously, you'll then need to use the measure values where you do this, instead of the original variables (or even set the variables to the measure values, if you prefer it like that).
Thank you
The Regexp code works fine for section numbers, but it does not work for dates...
The dates appear as "022.09.23"
I don't know where i going from here, but i promise it won't be boring...
tass_co wrote: ↑September 18th, 2023, 9:53 pm
Thank you
The Regexp code works fine for section numbers, but it does not work for dates...
The dates appear as "022.09.23"
Well, the content and the way you code it is up to you, not me... what you posted can't work if after all this time, you still add options that are specific to measures (like those related to the substitution) to meters instead...