How to get top two, and rounded to the nearest decimal point

Have recently seen a face Question: Internet is also no good answer; I have summarized this:
Title: How to get the decimal point and rounded first two
public void RoundMath (
public static void main () (
float t = 1898.879f;
t = Math.round (t);
t / = 100;
t = Math.round (t);
System.out.println (t);
)
)

分类:Java 时间:2008-09-13 人气:293
分享到:
blog comments powered by Disqus

相关文章

  • public void testStatementAddBatch () public void testConnCommit () 2011-09-01

    public void testStatementAddBatch() { Connection conn = null; Statement stmt = null; try { conn = getDBConnectionMsSqlBySuperAdmin(); stmt = conn.createStatement(); for(int i = 0; i < 100; i++) { String sql = " sql " + i; stmt.addBatch(sql);

  • Java logging framework of a system design and implementation (change) 2010-03-29

    1 Introduction Log tracking system is an indispensable debugging tool, especially in the background of any unattended procedures and debugging environment for those who do not follow the system has wide application. For a long time, the log system as

  • Understand the Android system of inter-process communication theory (a )---- RPC proxy mode in 2011-09-14

    [Size = medium] Android system to understand the principle of inter-process communication (a )---- RPC proxy mode in Android system inter-process communication is via a lightweight RPC (Remote Procedure Call remote procedure calls) and AIDL (Android

  • 常用的色彩空间的转换 2012-12-18

    转载的,留下学习! using System; using System.Drawing; namespace EngTyping.Class { /// <summary> /// ColorHandle 处理Rgb|Hsv的相互转换 /// </summary> internal class ColorHandle { public int H,S,V; public int R,G,B; public int C,M,Y,K; /// <summary> ///

  • java database connection pool to achieve 2010-03-29

    .package cc.vicp.eden.plug; . .import java.sql.*; .import java.util.*; .import java.lang.reflect.*; . ./** . * Connection pool class. . * . * @version 0.13 . * @author Eden . * . */ .public abstract class ConnectionPool { . /** . * Connection pooling

  • Java Common Questions 2 2009-03-01

    The following code will output what the outcome public class Test{ public static void main(String[] args){ Test o = new Test(); o.amethod(); } public void amethod(){ int oi = 012; System.out.println(oi); // The result is : 10 } } The following code w

  • Java Threads Summary 2010-04-28

    Often seen in the above forum thread helpless beginners, it summed up the following article, I hope some are learning to use java thread help beginners. First of all, the thread first need to know to understand some basic things, we are now used by m

  • groovy bit by bit 2 (transfer) 2010-05-07

    Groovy and Java, the same points are: 3 +, 4 +, 6 +, 8 +, 10 +, 12 +, 13, 14, 15, 18 +, 20 +, 21, 22, 23, 28 +, 29 +, 30 +, 31 +, 32 + That not only covers the Groovy + Java syntax, but also enhance the part. Groovy and Java differences are: 0, 1, 2,

  • Java Threads Summary (change) 2010-05-08

    In the forum thread above, I often see beginners on the helpless, so summed up the following article, I hope some are learning to use for beginners java thread help. First of all, the thread first need to know to understand some basic things, we are

  • JDBC learning summary 2010-09-18

    JDBC part of the terminal into mysql: mysql-u root Enter the terminal into the oracle: telnet 192.168.0.23 then sqlplus openlab/open123 MySQL frequently used commands: show databases; use tableName; show tables; An overview of JDBC JDBC from the phys

iOS 开发

Android 开发

Python 开发

JAVA 开发

开发语言

PHP 开发

Ruby 开发

搜索

前端开发

数据库

开发工具

开放平台

Javascript 开发

.NET 开发

云计算

服务器

Copyright (C) codeweblog.com, All Rights Reserved.

CodeWeblog.com 版权所有 黔ICP备15002463号-1

processed in 0.167 (s). 12 q(s)