小数例子: PHP保留两位小数并且四舍五入 $n=0.1265489;
echo?sprintf("%.2f",?$n);?//?0.13 大家可以看到我们用到了sprintf函数对$n进行了格式化%.2f是目标格式,其中2表示两位f表示float(浮点型) 第3为小...
分类:
Web程序 时间:
2015-02-05 18:50:57
阅读次数:
146
package com;
public class Welcome {
public static void main(String[] args) {
// TODO Auto-generated method stub
int a = 0b1001;
Float b = 11.5F;
Double c = 33.567D;
System.out.println...
分类:
编程语言 时间:
2015-02-05 18:23:24
阅读次数:
252
当ScrollView嵌套WebView的时候,如果需要调用WebView的setTextSise的时候,会出现底部一大片空白,试了很多方法都不管用,无意中找到了一个解决方案,居然可以了,我也是醉了,当初居然没有想到这么做.好了,下面看代码吧。
首先写一个重置WebView高度的方法
@JavascriptInterface
public void resize(final float hei...
分类:
Web程序 时间:
2015-02-05 13:41:17
阅读次数:
512
2015.2.4#include #include //struct//struct Goods//{// char name[20];// float price;// long amount;//};////int main(int argc, const char * argv[]) {...
分类:
移动开发 时间:
2015-02-04 23:10:32
阅读次数:
194
//若min-width:1000px;*html.ie6_out{margin-left:1000px;zoom:1;}*html.ie6_in{position:relative;float:left;margin-left:-1000px;}<body><!--[iflteIE6]><divclass="ie6_out"><divclass="ie6_in"><![endif]-->body内容<!--[iflteIE6]>&..
分类:
其他好文 时间:
2015-02-04 18:56:26
阅读次数:
88
一、数据类型:整数:int,bigint,smallint小数:float,real,decimal(长度,精度),numeric(长度,精度)字符:char(n),varchar(n) 8000英文字符,4000汉字 text——大文本。逻辑:bit 0,1/true/false二进制类型:bin...
分类:
数据库 时间:
2015-02-04 14:16:30
阅读次数:
208
#define () //宏定义函数加,编译时会替代成
例如:#define max(a,b) ((a)>(b)?(a):(b)) //这是大家经常会遇到的一个求较大值的函数(暂且让我称它为函数吧)
/*(1)与一般函数相比:宏函数会在编译时直接替代,不用传参,没有内存空间,相对省资源;宏函数编译时编译器不会检查语法等错误,若出现错误,要人工检查;但是宏函数不限制处理的参数数据类型,int能用,float也能用,一般函数则只能...
分类:
其他好文 时间:
2015-02-04 13:04:06
阅读次数:
108
String不是基本的数据类型,是final修饰的java类,java中的基本类型一共有8个,它们分别为:1 字符类型:byte,char2 基本整型:short,int,long3 浮点型:float,double4 布尔类型:boolean此外需要说明 有的文章中吧void也算是一种基本的数据类...
分类:
其他好文 时间:
2015-02-03 22:54:29
阅读次数:
181
loadingbar就是进度条,如果要实现进度条的滑动,我们必须要实现update函数例如:
void HelloWorld::update(float delta)
{
_count++;
if (_count > 100)
_count = 0;
LoadingBar * loadingBar = static_cast(getChildByTag(0));
loadingBa...
分类:
编程语言 时间:
2015-02-03 19:34:51
阅读次数:
232
using UnityEngine;
using System.Collections;
/**
* 备注:本脚本必须赋予主镜头
*/
public class CameraRotateAround : MonoBehaviour {
public Transform target;//主相机要围绕其旋转的物体
public float distanc...
分类:
编程语言 时间:
2015-02-03 11:08:18
阅读次数:
173