- 浏览: 2650041 次
- 性别:
- 来自: 北京
文章分类
最新评论
-
80后的童年2:
深入浅出MongoDB应用实战开发网盘地址:https://p ...
MongoDB入门教程 -
shliujing:
楼主在不是精通java和php的前提下,请不要妄下结论。
PHP、CakePHP哪凉快哪呆着去 -
安静听歌:
希望可以一给一点点注释
MySQL存储过程之代码块、条件控制、迭代 -
qq287767957:
PHP是全宇宙最强的语言!
PHP、CakePHP哪凉快哪呆着去 -
rryymmoK:
深入浅出MongoDB应用实战开发百度网盘下载:链接:http ...
MongoDB入门教程
显示最近的整数(四舍五入)
Math.round(204.499) // 204
Math.round(401.5) // 402
指定向上或向下
Math.floor(204.99) // 204
Math.ceil(401.01) // 402
控制精确度
Math.round(90.337 / .01) * .01 // 90.34
Math.round(92.5 / 5) * 5 // 95
Math.round(92.5 / 10) * 10 // 90
由此可以写一个Util类
NumberUtil.round(Math.PI) // 3
NumberUtil.round(Math.PI, .01) // 3.14
NumberUtil.round(Math.PI, .0001) // 3.1416
NumberUtil.round(123.456, 1) // 123
NumberUtil.round(123.456, 6) // 126
NumberUtil.round(123.456, .01) // 123.46
NumberFormat也是ASCB的一个Util类
var styler:NumberFormat = new NumberFormat("#,###,###,###.00");
Locale.slanguage = "fr";
trace(styler.format(1234)); // 1.234,00
trace(styler.format(12345, {group: ",", decimal: "."})); // 12,345.00
trace(styler.format(123456)); // 123.345,00
Locale.slanguage = "en";
trace(styler.format(1234567)); // 1,234,567.00
trace(styler.format(12345678, new Locale("es", "ES"))); // 12.345.678,00
trace(styler.format(123456789, {group: "|", decimal: ","})); // 123|456|789,00
Currency Amounts Formatting
var styler:NumberFormat = new NumberFormat();
trace(styler.currencyFormat(123456)); // $123,456.00
Locale.slanguage = "nl";
trace(styler.currencyFormat(123456)); // 123.456,00
trace(styler.currencyFormat(123456, new Locale("sv"))); // 123,456.00kr
trace(styler.currencyFormat(123456, {group: ",", decimal: ".",
currency: "@", before: false})); // 123,456.00@
生成随机数
// Generate a random integer from 0 to 100.
trace(NumberUtilities.random(0, 100));
// Generate a random multiple of 5 from 0 to 100.
trace(NumberUtilities.random(0, 100, 5));
// Generate a random number from -10 to 10, rounded to the
// nearest tenth.
trace(NumberUtilities.random(-10, 10, .1));
// Generate a random number from -1 to 1, rounded to the
// nearest five-hundredth.
trace(NumberUtilities.random(-1, 1, .05));
掷硬币
var randomNumber:Number = NumberUtilities.random(0, 1);
var text = (randomNumber == 0) ? "heads" : "tails";
掷骰子
var die1:uint = NumberUtilities.random(1, 6);
var die2:uint = NumberUtilities.random(1, 6);
var dice:uint = die1 + die2;
玩纸牌
// Deal four hands.
var hands:Array = cards.deal(4);
生成唯一数
// Display a unique number.
trace(NumberUtilities.getUnique());
角度转换
var converterToRadians:Converter = Unit.DEGREE.getConverterTo(Unit.RADIAN);
var converterToDegrees:Converter = Unit.RADIAN.getConverterTo(Unit.DEGREE);
trace(converterToRadians.convertWithLabel(1));
trace(converterToRadians.convertWithLabel(57.2957795130823));
trace(converterToDegrees.convertWithLabel(1));
trace(converterToDegrees.convertWithLabel(0.0174532925199433));
/*
Displays:
0.0174532925199433 radians
1 radian
57.2957795130823 degrees
1 degree
*/
计算两点之间的距离
var c:Number = Math.sqrt(Math.pow(a, 2) + Math.pow(b, 2));
计算圆上的点
x1 = x0 + (Math.cos(angle) * radius);
y1 = y0 + (Math.sin(angle) * radius);
量度转换
// Display the categories that are supported.
trace(Unit.getCategories( ));
// Display the units supported in the temperature category.
trace(Unit.getUnits("temperature"));
var converter:Converter = Unit.CELCIUS.getConverterTo(Unit.FAHRENHEIT);
trace(converter.convert(0)); // Displays: 32
Math.round(204.499) // 204
Math.round(401.5) // 402
指定向上或向下
Math.floor(204.99) // 204
Math.ceil(401.01) // 402
控制精确度
Math.round(90.337 / .01) * .01 // 90.34
Math.round(92.5 / 5) * 5 // 95
Math.round(92.5 / 10) * 10 // 90
由此可以写一个Util类
NumberUtil.round(Math.PI) // 3
NumberUtil.round(Math.PI, .01) // 3.14
NumberUtil.round(Math.PI, .0001) // 3.1416
NumberUtil.round(123.456, 1) // 123
NumberUtil.round(123.456, 6) // 126
NumberUtil.round(123.456, .01) // 123.46
NumberFormat也是ASCB的一个Util类
var styler:NumberFormat = new NumberFormat("#,###,###,###.00");
Locale.slanguage = "fr";
trace(styler.format(1234)); // 1.234,00
trace(styler.format(12345, {group: ",", decimal: "."})); // 12,345.00
trace(styler.format(123456)); // 123.345,00
Locale.slanguage = "en";
trace(styler.format(1234567)); // 1,234,567.00
trace(styler.format(12345678, new Locale("es", "ES"))); // 12.345.678,00
trace(styler.format(123456789, {group: "|", decimal: ","})); // 123|456|789,00
Currency Amounts Formatting
var styler:NumberFormat = new NumberFormat();
trace(styler.currencyFormat(123456)); // $123,456.00
Locale.slanguage = "nl";
trace(styler.currencyFormat(123456)); // 123.456,00
trace(styler.currencyFormat(123456, new Locale("sv"))); // 123,456.00kr
trace(styler.currencyFormat(123456, {group: ",", decimal: ".",
currency: "@", before: false})); // 123,456.00@
生成随机数
// Generate a random integer from 0 to 100.
trace(NumberUtilities.random(0, 100));
// Generate a random multiple of 5 from 0 to 100.
trace(NumberUtilities.random(0, 100, 5));
// Generate a random number from -10 to 10, rounded to the
// nearest tenth.
trace(NumberUtilities.random(-10, 10, .1));
// Generate a random number from -1 to 1, rounded to the
// nearest five-hundredth.
trace(NumberUtilities.random(-1, 1, .05));
掷硬币
var randomNumber:Number = NumberUtilities.random(0, 1);
var text = (randomNumber == 0) ? "heads" : "tails";
掷骰子
var die1:uint = NumberUtilities.random(1, 6);
var die2:uint = NumberUtilities.random(1, 6);
var dice:uint = die1 + die2;
玩纸牌
// Deal four hands.
var hands:Array = cards.deal(4);
生成唯一数
// Display a unique number.
trace(NumberUtilities.getUnique());
角度转换
var converterToRadians:Converter = Unit.DEGREE.getConverterTo(Unit.RADIAN);
var converterToDegrees:Converter = Unit.RADIAN.getConverterTo(Unit.DEGREE);
trace(converterToRadians.convertWithLabel(1));
trace(converterToRadians.convertWithLabel(57.2957795130823));
trace(converterToDegrees.convertWithLabel(1));
trace(converterToDegrees.convertWithLabel(0.0174532925199433));
/*
Displays:
0.0174532925199433 radians
1 radian
57.2957795130823 degrees
1 degree
*/
计算两点之间的距离
var c:Number = Math.sqrt(Math.pow(a, 2) + Math.pow(b, 2));
计算圆上的点
x1 = x0 + (Math.cos(angle) * radius);
y1 = y0 + (Math.sin(angle) * radius);
量度转换
// Display the categories that are supported.
trace(Unit.getCategories( ));
// Display the units supported in the temperature category.
trace(Unit.getUnits("temperature"));
var converter:Converter = Unit.CELCIUS.getConverterTo(Unit.FAHRENHEIT);
trace(converter.convert(0)); // Displays: 32
发表评论
-
Ext源码解析:3, DomHelper.js
2008-07-15 16:45 2375from http://www.beyondrails.com ... -
Ext源码解析:2, DomQuery.js
2008-07-11 10:54 2546fromhttp://www.beyondrails.com/ ... -
Ext源码解析:1, Ext.js
2008-07-09 18:08 2887来自http://www.beyondrails.com/bl ... -
Extjs Introduction
2008-07-08 02:04 8767from http://hideto.beyondrails. ... -
模拟Ajax提交上传文件
2008-06-04 00:24 4184XMLHTTP不支持文件上传这种form提交,但是我们可以模拟 ... -
escape JavaScript
2008-03-27 16:55 2600单引号、双引号、<script></scri ... -
Multiple IE
2007-11-22 10:35 2499老问题,js和css对跨浏览器兼容问题 在一台电脑上共存IE3 ... -
编辑表单后离开本页面时做提示(jQuery版)
2007-11-15 15:21 4987添加如下JavaScript: $.fn.enable_c ... -
正确使用Prototype,节省额外的100K
2007-11-10 23:20 3058Part I: http://thinkweb2.com/pr ... -
十大Web应用漏洞清单,XSS排名第一
2007-10-22 12:36 3050owasp.org列出十大Web应用漏洞清单: 1, Cros ... -
IE下不能disabled掉select标签的option的解决方案
2007-10-11 17:48 8969原文:Select, Option, Disabled And ... -
Jester: JavaScript Client for REST
2007-09-04 13:51 2680Jester: JavaScriptian REST介绍了Je ... -
ASCB阅读笔记五、Arrays
2007-08-23 10:47 1788var array:Array = new Array() ... -
ASCB阅读笔记三、Runtime Environment
2007-08-10 23:34 24791,检测用户浏览器安装的Flash Player版本 http ... -
ASCB阅读笔记二、Custom Classes
2007-08-09 10:54 13401,ActionScript 3.0已经完全OO,所有AS代码 ... -
ASCB阅读笔记一、ActionScript Basics
2007-08-07 23:29 20091,使用trace来debug程序 package { ... -
method_missing in ActionScript 3/Flex
2007-08-07 18:05 1954method_missing in ActionScript ... -
Hilog 0.1 released.
2007-08-07 00:52 2050Hilog 0.1 release is a demo of ... -
在客户端保存状态
2007-08-05 18:13 3708Keeping State on the Client 在第 ... -
介绍Cairngorm
2007-08-05 15:36 19680Cairngorm是Adobe Labs上的Flex MVC框 ...
相关推荐
ascb包,直接解压放在src目录下。其中具体用法,还是得找些文档
通过ASCB包,可以在FLEX环境中对字符、数字、日期等进行各种快捷的函数处理。如字符转为日期等。
This manual describes the Goebel NIC, a test resource for exercising ASCB-D interface bus on Honeywell EPIC programs. This is a new generation of test equipment designed specifically for simulation.
但是大多数的图形用Graphics API还是很难画出的,AS3CBLibrary (http://www.rightactionscript.com/ascb) 提供了一个 ascb.drawing.Pen 类。Pen 类是Graphics 类的代理(包装)类。你可以构造一个新的Pen 实例然后...
但是大多数的图形用Graphics API还是很难画出的,AS3CBLibrary (http://www.rightactionscript.com/ascb) 提供了一个 ascb.drawing.Pen 类。Pen 类是Graphics 类的代理(包装)类。你可以构造一个新的Pen 实例然后...
安科瑞ASCB1系列智能微型断路器样本,
安科瑞ASCB1系列智能微型断路器产品使用,安装说明书
AS3CBLibrary资源包,ascb包,各种as类
flash actionscript3 as3游戏开发教程合集(2本经典合一)+AS3CBLibrary_ascb包.zip
一款带有代码的flash小游戏,直接下载,马上可以打开,不用解压缩.
本文档告诉读者怎样将ASP封装成DLL,需要使用word2007打开文档。
if iFileNameStart>0 and iFileNameStart iFileNameEnd=inString(iFileNameStart+10,"""") mFileName=subString(iFileNameStart+10,iFileNameEnd-iFileNameStart-10) iStart=inString(iFileNameEnd+1,...
ThisCharCode = AscB(MidB(vIn,i,1)) If ThisCharCode ; Then strReturn = strReturn & Chr(ThisCharCode) Else NextCharCode = AscB(MidB(vIn,i+1,1)) strReturn = strReturn & Chr(CLng(ThisCharCode) * &...
if iFileNameStart>0 and iFileNameStart iFileNameEnd=inString(iFileNameStart+10,"""") mFileName=subString(iFileNameStart+10,iFileNameEnd-iFileNameStart-10) iStart=inString(iFileNameEnd+1,vbEnter&...
ASCB 鞍山银行 ARCU 安徽省农村信用社 BJBANK 北京银行 BJRCB 北京农商行 BSB 包商银行 BOHAIB 渤海银行 BDCBANK 保定银行 BOCFCB 中银富登村镇银行
[removed] Function bytes2BSTR(vIn) strReturn = “” For i = 1 To LenB(vIn) ThisCharCode = AscB(MidB(vIn,i,1)) If ThisCharCode < &H80 Then strReturn = strReturn & Chr(ThisCharCode)...
s = s & chr(ascb(midb(binary, i, 1))) next binarytostring= s end function function rsbinarytostring(xbinary) dim binary if vartype(xbinary)=8 then binary = multibytetobinary(xbinary) ...
@LANGUAGE=”JScript” CODEPAGE=”936″%> [removed] Function bytes2BSTR(vIn) strReturn = “” For i = 1 To LenB(vIn) ThisCharCode = AscB(MidB(vIn,i,1)) If ThisCharCode < &H80 Then ...
Function bytes2BSTR(vIn)strReturn = “”For i = 1 To LenB(vIn)ThisCharCode = AscB(MidB(vIn,i,1))If ThisCharCode < &H80 ThenstrReturn = strReturn & Chr(ThisCharCode)ElseNextCharCode = AscB(MidB(vIn,...