커뮤니티

고용노동부, 산업인력공단과 함께하는 강원도 유일한 기업중심 IT전문교육기관 ICT융합캠퍼스만의 특별한교육입니다.
공인 IT숙련기술인의 다양한 접근방법으로 전문가다운 실무교육을 받을 수 있습니다.

Category

교육강좌

클라이언트 JavaScript 사전 - toExponential

페이지 정보

작성자 관리자 댓글 0건 조회 2,134회 작성일 20-07-20 15:10

본문

toExponential

요약(Summary)

수에 대한 지수표현식을 리턴

문법(Syntax)

1
number.toExponential([fractionDigits])

인자(Parameters)

인자명 데이터형 필수/옵션 설명
fractionDigits number 필수 0~20사이의 정수,소수점 이후에 표기할 자리수

반환값(Return)

string, 지수 표기법으로 반환된 문자열

설명(Description)

과학에서는 큰 수를 표시할 때 지수표기법을 사용한다.
예를들어 2.534의 지수표기법은 2.534e+0인데 이것은 2.534*100을 의미하고 2.534e+2는 2.534*102인 253.4를 의미한다.

예제(Example)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
var num = new Number(2.534);
alert(num.toExponential()); // string, <span class="objectBox objectBox-text " role="presentation">2.534e+0</span>
var num = new Number(25.34);
alert(num.toExponential()); // string, 2.534e+1
var num = new Number(253.4);
alert(num.toExponential()); // string, 2.534e+2
var num = new Number(2534);
alert(num.toExponential()); // string, 2.534e+3
var num = new Number(2534);
alert(num.toExponential(1)); // string, 2.5e+3

 

  • 트위터로 보내기
  • 페이스북으로 보내기
  • 구글플러스로 보내기

답변목록

등록된 답변이 없습니다.