java warning to .format()

Post Reply
User avatar
seal58
Posts: 377
Joined: Fri Jul 12, 2019 5:28 pm
Location: Rostock, Germany
Contact:

java warning to .format()

Post by seal58 »

Hi there,

I'm not really familiar with JAVA yet and try to convert a double to a string using format().
Compiler gives a warning. Nevertheless it works fine in my project.
Before that line the newString was ceated and initialized.
format-warning.jpg
format-warning.jpg (38.26 KiB) Viewed 1444 times
Should I change anything?
User avatar
honki-bobo
Posts: 310
Joined: Sat Nov 09, 2019 1:18 pm

Re: java warning to .format()

Post by honki-bobo »

format() is a static method, not an object method.

Try

Code: Select all

newString = String.format(%6.2f", value);
Image
Monkey Business Audio
Modules - Music - Twitter - YouTube
User avatar
seal58
Posts: 377
Joined: Fri Jul 12, 2019 5:28 pm
Location: Rostock, Germany
Contact:

Re: java warning to .format()

Post by seal58 »

That fixed it. Many thanks!
Post Reply

Return to “Module Designer”