This is great!! i tried it and it work. Just a thought... why is it that when directly dividing 10/100 the result is 0 but if in a method it generated the correct answer?
Thank you very much!!! Dave On Mar 14, 1:09 am, Shawn Ayromloo <[email protected]> wrote: > You can divide a number by a larger number - in non-integer mode. > Is this what you need?public class Rate { > static float rate (float percent) { > return (percent / 100); > } > public static void main(String[] args) { > System.out.println (rate (10)); > System.out.println (rate (20)); > } > }run: > 0.1 > 0.2 > BUILD SUCCESSFUL (total time: 0 seconds) > --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/javaprogrammingwithpassion?hl=en -~----------~----~----~----~------~----~------~--~---
