#,##0.0000;;#请问这是什么意思?#呀等符号代表什么?

解决方案 »

  1.   

    0 Digit place holder. If the value being formatted has a digit in the position where the '0' appears in the format string, then that digit is copied to the output string. Otherwise, a '0' is stored in that position in the output string.
    # Digit placeholder. If the value being formatted has a digit in the position where the '#' appears in the format string, then that digit is copied to the output string. Otherwise, nothing is stored in that position in the output string.
    . Decimal point. The first '.' character in the format string determines the location of the decimal separator in the formatted value; any additional '.' characters are ignored. The actual character used as a the decimal separator in the output string is determined by the DecimalSeparator global variable or its TFormatSettings equivalent.
    , Thousand separator. If the format string contains one or more ',' characters, the output will have thousand separators inserted between each group of three digits to the left of the decimal point. The placement and number of ',' characters in the format string does not affect the output, except to indicate that thousand separators are wanted. The actual character used as a the thousand separator in the output is determined by the ThousandSeparator global variable or its TFormatSettings equivalent.
    E+ Scientific notation. If any of the strings 'E+', 'E-', 'e+', or 'e-' are contained in the format string, the number is formatted using scientific notation. A group of up to four '0' characters can immediately follow the 'E+', 'E-', 'e+', or 'e-' to determine the minimum number of digits in the exponent. The 'E+' and 'e+' formats cause a plus sign to be output for positive exponents and a minus sign to be output for negative exponents. The 'E-' and 'e-' formats output a sign character only for negative exponents.
    'xx'/"xx" Characters enclosed in single or double quotes are output as-is, and do not affect formatting.
    ; Separates sections for positive, negative, and zero numbers in the format string.
      

  2.   

    function FormatFloat(const Format: string; Value: Extended): string; overload;0 Digit place holder. If the value being formatted has a digit in the position where the '0' appears in the format string, then that digit is copied to the output string. Otherwise, a '0' is stored in that position in the output string.
    如果被格式化的Value在出现'0'的位置有个数字,那么将显示这个数字;如果没有则该位置显示'0'
    # Digit place holder. If the value being formatted has a digit in the position where the '#' appears in the format string, then that digit is copied to the output string. Otherwise, nothing is stored in that position in the output string.
    如果被格式化的Value在出现'#'的位置有个数字,那么将显示这个数字;如果没有则该位置不显示任何字符
    . Decimal point. The first '.' character in the format string determines the location of the decimal separator in the formatted value; any additional '.' characters are ignored. The actual character used as a the decimal separator in the output string is determined by the DecimalSeparator global variable or its TFormatSettings equivalent.
    在Format字符串中出现的第一个'.'确定了小数点的位置,其它的都会被忽略。实际输出的小数点分隔符是由DecimalSeparator全局变量或者TFormatSettins确定的。
    , Thousand separator. If the format string contains one or more ',' characters, the output will have thousand separators inserted between each group of three digits to the left of the decimal point. The placement and number of ',' characters in the format string does not affect the output, except to indicate that thousand separators are wanted. The actual character used as a the thousand separator in the output is determined by the ThousandSeparator global variable or its TFormatSettings equivalent.
    如果Format字符串包含一个或多个',',输出的字符串中将会在小数点左边每三位加入一个千分符,','出现的位置和数量并不影响输出,只是用于指示需要显示千分符。实际输出的千分符是由ThousandSeparatorr全局变量或者TFormatSettins确定的。
    E+ Scientific notation. If any of the strings 'E+', 'E-', 'e+', or 'e-' are contained in the format string, the number is formatted using scientific notation. A group of up to four '0' characters can immediately follow the 'E+', 'E-', 'e+', or 'e-' to determine the minimum number of digits in the exponent. The 'E+' and 'e+' formats cause a plus sign to be output for positive exponents and a minus sign to be output for negative exponents. The 'E-' and 'e-' formats output a sign character only for negative exponents.
    如果Format字符串包含'E+', 'E-', 'e+', 或者 'e-' ,输出的字符串将会使用Value的科学计数表示法。一组小于等于4个'0'可以直接跟在'E+', 'E-', 'e+', 'e-'后,用于确定指数。'E+''e+'会在正指数时输出正号、负指数时输出负号,'E-''e-'只用于输出负指数。
    'xx'/"xx" Characters enclosed in single or double quotes are output as-is, and do not affect formatting.
    在单引号或双引号中的字符会原样输出。
    ; Separates sections for positive, negative, and zero numbers in the format string.
    用于分隔 正数格式;负数格式;0例:
    Format string- 1234 -1234 0.5 0
    1234 -1234 0.5 0
    0 1234 -1234 1 0
    0.00  1234.00 -1234.00 0.50 0.00
    #.##   1234 -1234 .5
    #,##0.00 1,234.00 -1,234.00 0.50 0.00
    #,##0.00;(#,##0.00) 1,234.00 (1,234.00) 0.50 0.00
    #,##0.00;;Zero  1,234.00 -1,234.00 0.50 Zero
    0.000E+00    1.234E+03 -1.234E+03 5.000E-01 0.000E+00
    #.###E-0   1.234E3 -1.234E3 5E-1 0E0
      

  3.   

    例:
    Format string-     1234      -1234      0.5       0
                       1234      -1234      0.5       0
    0                  1234      -1234      1         0
    0.00               1234.00   -1234.00   0.50      0.00
    #.##               1234      -1234      .5
    #,##0.00           1,234.00  -1,234.00  0.50      0.00
    #,##0.00;(#,##0.00)1,234.00  (1,234.00) 0.50      0.00
    #,##0.00;;Zer      1,234.00  -1,234.00  0.50      Zero
    0.000E+00          1.234E+03 -1.234E+03 5.000E-01 0.000E+00
    #.###E-0           1.234E3   -1.234E3   5E-1      0E0