Here you can find the source of formatTimeToFloat(Time inputTime)
Parameter | Description |
---|---|
inputTime | a parameter |
public static String formatTimeToFloat(Time inputTime)
//package com.java2s; //License from project: Apache License import org.joda.time.DateTime; import java.sql.Time; public class Main { /**/*from ww w . j a va 2 s . c o m*/ * Method used in constructing the appointment scheduling py script input. * This method converts the given time in to the corresponding decimal equivalent of floating point representation. * Ex. 6:30 = 6.5 * 6:45 = 6.75 * @param inputTime * @return */ public static String formatTimeToFloat(Time inputTime) { DateTime jodaTime = new DateTime(inputTime); int secsTime = jodaTime.getSecondOfDay(); long beforeRound = Math.round((secsTime / 60.0d / 60.0d) * 10); float result = beforeRound / 10; return String.valueOf(result); } }