Java tutorial
//package com.java2s; //License from project: Apache License public class Main { public static float getRating(String rate) { if (rate != null) { if (rate.length() == 2) { return Float.valueOf(rate) / 10; } else { return Float.valueOf(rate); } } return 0; } }