But the setValue() method converts the input argument to int, so the fractional part of the value is lost.
But the setValue() method converts the input argument to int, so the fractional part of the value is lost.
Change the scale of the progress bar range. If you now have it set to range from 0 - 100, and you want one decimal place, change it to a range of 0 - 1000. Use ChrisW67's method to format the text by converting the value to a float, dividing by 10, and use the result to set a float formatted string.But the setValue() method converts the input argument to int, so the fractional part of the value is lost.
You will also have to change the code that sets the value to multiply the number passed to setValue() by 10.
<=== The Great Pumpkin says ===>
Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.
Works perfectly! Thanks. I tried to find a good excuse for not thinking of this myself, but couldn't find one ...
Bookmarks