社区
Java SE
帖子详情
easy thing!!!!!!!!!
JollySandy
2003-10-19 12:55:57
请问如何截取float或double型的小数位?-------急!!!!!!!!!!!!!!
...全文
34
5
打赏
收藏
easy thing!!!!!!!!!
请问如何截取float或double型的小数位?-------急!!!!!!!!!!!!!!
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
5 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
老土豆T
2003-10-20
打赏
举报
回复
To: JollySandy()
你的方法和不错啊 (我脸红中。:)
Float.parseFloat(b);
Double.parseDouble(b);
JollySandy
2003-10-19
打赏
举报
回复
to all:
那么这样保留自然数E中的前4位小数可以吗?
String b = String.valueof(Math.E);
b = b.substring(1,6);
System.out.println(b);
如果我想把b再次转换成double型的话又应该如何做?
多谢!
alienbat
2003-10-19
打赏
举报
回复
1。强制赋值转换为整数(int)
2。把float型或者double型的数据减去上面得到的整数。
老土豆T
2003-10-19
打赏
举报
回复
一些偏方。。:)
float aaa =1212.1213;
int bbb= aaa % 1 ; //取整
float ccc= aaa-bbb ; //减去整,得到小数
String ddd =""+ccc ; //转化为字符串,将小数转化为字符串
SwordsmanF
2003-10-19
打赏
举报
回复
double a=1212.1213;
String b=String.valueOf(a);
b=b.substring(b.indexOf(".")+1,b.length());
System.out.println(b);
Easy
Mobile Pro 2.2.2
游戏出海快速对接广告平台工具包 unity跨平台多功能手机游戏工具包
Easy
Mobile Pro v2.2.2 所支持的Unity版本:5.5.5 及以上版本 With version 2.2.0, we introduce the hugely awaited feature: multiplayer! This makes
Easy
Mobile Pro the first Unity plugin ever to offer a truly cross-platform API for Turn-Based and Real-Time multiplayer on iOS and Android - one that not only combines, but actually unifies the native APIs to create a single API and a single workflow for developing multiplayer games that work for both iOS and Android!
Easy
Mobile is a many-in-one package that greatly simplifies the implementation of standard features on every mobile game such as advertising, in-app purchasing, game services, notifications, sharing, etc. It takes care of these "necessary evils" so you can focus your time on doing the most important thing in game development: creating fun! This is the Pro version of
Easy
Mobile. Other version: EM Basic * See the feature comparison image for differences between EM Pro and EM Basic. ? HIGHLIGHTS ? Cross-platform: intuitive, cross-platform API that can accomplish most tasks with a single line of code. ? Friendly Editor: beautiful &
easy
-to-use editor for controlling everything from one place. ? Automation: automating chores such as service initialization and ad loading. ? Modular Design: use only what are needed and not be worried about redundancies or contradictions with existing code. ? Leveraging Official SDKs: to form a coherent system that maximizes usability and reliability - without reinventing the wheel!
Easy
Mobile Pro 2.1.1
unity3D开发用的插件,手机游戏广告,应用内购,游戏服务,通知,分享,等等。
Easy
Mobile is a many-in-one package that greatly simplifies the implementation of standard features on every mobile game such as advertising, in-app purchasing, game services, notifications, sharing, etc. It takes care of these "necessary evils" so you can focus your time on doing the most important thing in game development: creating fun!
Varian.SkinFactory.v1.01(2000)
A great and
easy
way to create advanced looking forms like Winamp and other multimedia applications. Designing skinable forms was never this
easy
before using the WYSIWYG designer tool. Create a skin just by loading your designed images into the designer. Define some buttons, labels and sliders and save the script to disk. The only thing left is to add a TSkin component to your form and load the script file. Now you are ready to release your first skinable application! The following features are currently available:- support bmp and jpeg files - support graphic buttons, including switch-style buttons - support text labels- support graphic slider bars- support multi skins, you can give a skin to each form of the application- full source code including the WYSIWYG designer
Android代码-Virtual SoftKeys
VirtualSoftKeys Overview A simple , safe and
easy
softKeys ( navigation bar). This project just was used for my device to solve hardware button problem. If you have any idea for any thing, please let me know! Features As system navigation bar No any extra permission Support stylus Todo More setting at navigation bar and touch view More color and icon for choice Add teaching page Known issues In some devices (e.g. ASUS Z500M) , accessibilty has some problem , I can't solve it . Just waiti
Android代码-albhedroid
Introduction Albhedroid is a simple substitution cipherer for Google Android, preloaded with the Al Bhed cipher of Squaresoft RPG fame. This is my very first Android app. I've made it a practice to re-implement this app the first thing I do whenever I'm learning a new language or platform. The reason is that it's fairly
easy
to do, but still involves common UI programming, event handling and string transformation. In other words, it's a bit more interesting than a simple "Hello, world!". U
Java SE
62,614
社区成员
307,326
社区内容
发帖
与我相关
我的任务
Java SE
Java 2 Standard Edition
复制链接
扫一扫
分享
社区描述
Java 2 Standard Edition
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章