num2str的使用

WBOY
WBOY원래의
2016-06-07 15:14:371973검색

num2str(real number,int characters,int decimals,int separator1,int separator2) Converts the decimal number specified by number to a text string. The minimum number of characters required in the text is specified by characters, and the requ

num2str(real number,int characters,int decimals,int separator1,int separator2)

Converts the decimal number specified by number to a text string. The minimum number of characters required in the text is specified by characters, and the required number of decimals is specified by decimals. The decimal separator required in the text is specified by separator1, and the thousands separator required in the text is specified by separator2.

The possible values for separator1 are:

  • '1': a '.' (point)
  • '2': a ',' (comma)

The possible values for separator2 are:

  • '0': no thousands separator
  • '1': a '.' (point)
  • '2': a ',' (comma)
  • '3': a ' ' (space)

MorphX replaces any invalid parameter with a standard value.

Examples

Num2Str(12345.6,10,2,2,1) returns "12.345,60".

Num2Str(12345.6,1,0,1,0) returns "12346".  

성명:
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.