I want to add a bit more onto this. This document is very useful:
Also, if youâre unsure about the â.2â is before f, itâs basically stating how many decimal places to provide after the period. Source
If you want to know about what floats, doubles, etc. do and how they work, check out my tutorial video explaining what they mean here.
however the output gives: Battery lvl: 100
the percent sign is still missing. I have tried many variations of this including /% and others but nothing sems to work. Anyone have a solution?
yea, this is an unfortunate side effect of the string getting parsed through a sprintf like function more than once.
here are two ways that work, they may not work in the future if I ever address that bug.
Do you know of a particular place in TM that doesnât handle percent signs correctly? If so, sharing that information so it can be fixed would be appreciated.
Printf style â%â format specifiers are already confusing for the novice programmers. It would be so much better if everything was kept as simple and as close to standard C behavior as possible. This way they could rely on multiple online tutorials covering legacy C programming.
No, itâs a bug I need to deal with, itâs just been low priority. Itâs wonât get fixed in 1.0.13 (or the next VEXcode release as it may be an SDK issue) as we already have a release candidate, but perhaps the following one.
Thatâs on me. I was converting some really old python strings from the old style (using the % operator) and forgot to delete the %. It has nothing to do with escaping a percent sign.
Your post that I quoted above was appropriate and helpful. It would have been better if you led with that post instead of the unnecessary and incorrect snark in your first post. Please try to always be respectful when interacting with others whether itâs in person or on a public forum.
Iâd say if it was an old established bug you hadnât gotten around to solving. Snark like âsays the guy who canât do Xâ would be warranted.
But given the situation a âhey speaking of percent signsâ with the picture would have been much more appropriate. Or a separate thread / bug report of course.