首页 >> 牛刀云小程序开发教程 >> 附录 >> 系统API >> 表达式编辑器函数API

22.2.7 随机数函数

1、wx.RandomUtilFn.randomInt(Integer) 创建一个整数类型的随机数

2、wx.RandomUtilFn.random() 创建一个大于等于0且小于1的随机数,

3、wx.RandomUtilFn.randomString(Integer) 创建一个指定长度的字母和数字的随机组合字符串

4、wx.RandomUtilFn.randomAlphabetic(Integer) 创建一个指定长度的字母随机字符串

5、wx.RandomUtilFn.randomNumber(Integer)创建一个随机数字字符串