Quite lots of ways..^^^
所在版块:社会百科 发贴时间:2003-01-21 01:15  评分:

用户信息
复制本帖HTML代码
高亮: 今天贴 X 昨天贴 X 前天贴 X 
Try to get familiar with some funny stuffs, like:

class test {

public static void main (String args[]) {
double i = 0.5;
double j = 0.3;
Double result = new Double (i/j);
String output = result.toString();
int index = output.indexOf('.');
System.out.println (output.substring(0,index+1+2));
}//main

}
.
欢迎来到华新中文网,踊跃发帖是支持我们的最好方法!

Speed Up...
 相关帖子 我要回复↙ ↗回到正文
java里面怎么format number? 辰星   (110 bytes , 647reads )
Quite lots of ways..^^^ maserati   (321 bytes , 359reads )
[SUGGESTION]THIS IS WRONG! 不告诉你   (61 bytes , 218reads )
如果你是说CS1102 lab 0的话 Climbing   (743 bytes , 292reads )
hey!!! 你怎么干这种事? 采心   (55 bytes , 245reads )
lab 0 lah Climbing   (8 bytes , 190reads )
.......是不应该给答案,但也不应该这样地骂。。。 coolapple   (0 bytes , 173reads )
:$ 采心   (85 bytes , 206reads )
haha... 不告诉你   (0 bytes , 185reads )
here SmellsLikeTeenSpirit   (177 bytes , 203reads )