zoukankan      html  css  js  c++  java
  • FormatFloat 格式化浮点数

    #和0的区别:

       #是对应位有值显示,无值不显示

       0是对应位有值显示,无值显示0

    分号后的字符串是对负值的格式化特殊定义:

     s := FormatFloat('00.0;(0.00)',1.123); 
     //返回: 01.1
    s := FormatFloat('00.0;(0.00)',-1.123); 

     //返回: (1.12)

     其他格式化:

     s := FormatFloat('###.###',12.3456); 
      //返回: 12.346 
      s := FormatFloat('000.000',12.3456); 
      //返回: 012.346 
     
      s := FormatFloat('#.###',12.3); 
      //返回: 12.3 
      s := FormatFloat('0.000',12.3); 
      //返回: 12.300 
     
      s := FormatFloat('#,#.#',1234567); 
      //返回: 1,234,567 
      s := FormatFloat('0,0.0',1234567); 
      //返回: 1,234,567.0 
     
      s := FormatFloat('0.00E+0',1234567); 
      //返回: 1.23E+6 
      s := FormatFloat('0.00E+00',1234567); 
      //返回: 1.23E+06 

  • 相关阅读:
    js 词法作用域揭秘
    Python 操作 Redis 发布订阅
    Logistic Regression
    快速逆平方根
    牛顿法
    Ubuntu安装BCC
    树莓派4b安装Ubuntu20.04
    丢弃法
    SpringBoot整合Redis
    Linear Regression
  • 原文地址:https://www.cnblogs.com/railgunman/p/9491940.html
Copyright © 2011-2022 走看看