본문으로 건너뛰기
더시드위키
최근 변경
최근 토론
도구 모음
틀
계산기2
(r74판 RAW)
보기
RAW
역사
[[분류:냥]][Include(틀:상세 내용, 설명대상=원본, 문서명=틀\:계산기)] == 2-2 == {{{#!wiki style="font-weight: 300; font-size: 20px" {{{#!wiki style="display: none" ##초기화 '''as''' : "a" value to string; '''bs''' : "b" value to string; '''al''' : "a" string length (integer); '''bl''' : "b" string length (integer) '''ad''' : "a" decimal point (integer); '''bd''' : "b" decimal point (integer); '''au''' : --gold-- "a" upper value (string→integer); '''bu''' : "b" upper value (string→integer); '''ab''' : "a" below value (string→integer); '''bb''' : "b" below value (string→integer); '''ap''' : "a" # of places of decimal (integer); '''bp''' : "b" # of places of decimal (integer); 0.303과 0.0303은 다른 수이므로 자리수가 다름을 표시할 용도 '''ru''' : "result" upper value (integer→string); '''rb''' : "result" below value (integer→string); '''rp''' : "result" # of places of decimal (integer); {{{#!if this.as=a.toString(), this.bs=b.toString(), this.ru=0+0, this.rb=0+0 }}}{{{#!if this.al=as.length, this.bl=bs.length, this.ad=as.indexOf("."), this.bd=bs.indexOf(".") }}}{{{#!if ad!=-1 소수점이 발견되는 자리 번호가 ad이므로 ad+1번에 해당되는 자리부터 끝까지 표기. {{{#!if this.au=as.substr(0,ad), this.ab=as.substr(ad+1, al-ad-1), this.ap=ab.length }}}{{{#!if (au=="")||(au=="-")||(au=="+") .12345 식으로 또는 -.12345 식으로 기입할 경우 upper 값을 0으로 부여함. {{{#!if au="0" }}}}}}}}}{{{#!if ad==-1 {{{#!if this.au=as, ab="", ap=0+0 }}}}}}{{{#!if bd!=-1 {{{#!if this.bu=bs.substr.(0,bd), this.bb=bs.substr(bd+1, bl-bd-1), this.bp=bb.length }}}{{{#!if (bu=="")||(bu=="-")||(bu=="+") {{{#!if bu="0" }}}}}}}}}{{{#!if bd==-1 {{{#!if this.bu=bs, bb="", bp=0+0 }}}}}} ##유효성 검사. the seed에서 지원되는 long(integer)가 unsigned였으면 1844경까지 가서 충분히 19자리로 놀 수 있었는데, signed long이므로 922경까지 가능한 공간에서 18자리로 잘라내기. 소수점 위 최대 18자리, 소수점 아래 최대 18자리 {{{#!if au.length>19 error code of a 01번 : 오버플로 {{{#!if ea=1 }}}}}} {{{#!if ab.length>19 warning code of a 01번 : 소수점 아래 자릿수를 너무 많이 입력했습니다. 소수점 아래 18자리까지만 취급합니다. {{{#!if wa=1, ab=ab.substr(0,18) }}}}}} {{{#!if bu.length>19 error code of b 01번 : 오버플로 {{{#!if eb=01 }}}}}} {{{#!if bb.length>19 warning code of b 01번 : 소수점 아래 자릿수를 너무 많이 입력했습니다. 소수점 아래 18자리까지만 취급합니다. {{{#!if wb=01, bb=bb.substr(0,18) }}}}}} ##반점(,)을 자동적으로 생략하고 들어가는 것은 나중에 생각하겠습니다. error code 02 번 : 입력한 변수는 숫자로 읽을 수 없습니다. 반점(,)을 입력했다면 반점을 지우고 다시 입력하세요. 덧셈과 뺄셈 계산과정을 적어봅니다. {{{#!if (f=="+")||(f=="-") 소수점 아래를 계산하려면 자릿수를 똑같이 맞춰야 의미가 있으므로, 자릿수가 다른 경우 자릿수가 같게 만드는 과정을 먼저 거칩니다. {{{#!if ap>bp 이를테면 a의 소수점 자릿수가 b의 소수점 자릿수보다 많으면 b뒤에 0을 더 추가하는 방식으로 변경합니다. b 자체가 정수여도 앞에 (소수점이 없을 경우) 이미 bb="", bp=0+0으로 초기화했으므로 동작될 것입니다. {{{#!if bp+=1, bb=bb+"0" }}}}}}{{{#!if ap>bp {{{#!if bp+=1, bb=bb+"0" }}}}}}{{{#!if ap>bp {{{#!if bp+=1, bb=bb+"0" }}}}}}{{{#!if ap>bp {{{#!if bp+=1, bb=bb+"0" }}}}}}{{{#!if ap>bp {{{#!if bp+=1, bb=bb+"0" }}}}}} {{{#!if ap>bp {{{#!if bp+=1, bb=bb+"0" }}}}}}{{{#!if ap>bp {{{#!if bp+=1, bb=bb+"0" }}}}}}{{{#!if ap>bp {{{#!if bp+=1, bb=bb+"0" }}}}}}{{{#!if ap>bp {{{#!if bp+=1, bb=bb+"0" }}}}}}{{{#!if ap>bp {{{#!if bp+=1, bb=bb+"0" }}}}}} {{{#!if ap>bp {{{#!if bp+=1, bb=bb+"0" }}}}}}{{{#!if ap>bp {{{#!if bp+=1, bb=bb+"0" }}}}}}{{{#!if ap>bp {{{#!if bp+=1, bb=bb+"0" }}}}}}{{{#!if ap>bp {{{#!if bp+=1, bb=bb+"0" }}}}}}{{{#!if ap>bp {{{#!if bp+=1, bb=bb+"0" }}}}}} {{{#!if ap>bp {{{#!if bp+=1, bb=bb+"0" }}}}}}{{{#!if ap>bp {{{#!if bp+=1, bb=bb+"0" }}}}}}{{{#!if ap>bp {{{#!if bp+=1, bb=bb+"0" }}}}}} 소수점 아래 최대 18자리까지의 수를 취급하므로 최대 18회. 반대로 b의 소수점 자릿수가 많은 경우도 있습니다. {{{#!if bp>ap {{{#!if ap+=1, ab=ab+"0" }}}}}}{{{#!if bp>ap {{{#!if ap+=1, ab=ab+"0" }}}}}}{{{#!if bp>ap {{{#!if ap+=1, ab=ab+"0" }}}}}}{{{#!if bp>ap {{{#!if ap+=1, ab=ab+"0" }}}}}}{{{#!if bp>ap {{{#!if ap+=1, ab=ab+"0" }}}}}} {{{#!if bp>ap {{{#!if ap+=1, ab=ab+"0" }}}}}}{{{#!if bp>ap {{{#!if ap+=1, ab=ab+"0" }}}}}}{{{#!if bp>ap {{{#!if ap+=1, ab=ab+"0" }}}}}}{{{#!if bp>ap {{{#!if ap+=1, ab=ab+"0" }}}}}}{{{#!if bp>ap {{{#!if ap+=1, ab=ab+"0" }}}}}} {{{#!if bp>ap {{{#!if ap+=1, ab=ab+"0" }}}}}}{{{#!if bp>ap {{{#!if ap+=1, ab=ab+"0" }}}}}}{{{#!if bp>ap {{{#!if ap+=1, ab=ab+"0" }}}}}}{{{#!if bp>ap {{{#!if ap+=1, ab=ab+"0" }}}}}}{{{#!if bp>ap {{{#!if ap+=1, ab=ab+"0" }}}}}} {{{#!if bp>ap {{{#!if ap+=1, ab=ab+"0" }}}}}}{{{#!if bp>ap {{{#!if ap+=1, ab=ab+"0" }}}}}}{{{#!if bp>ap {{{#!if ap+=1, ab=ab+"0" }}}}}} }}} 위의 과정을 거치게 되면 소수점 아래 최대 자릿수를 똑같이 맞춘 상태에서 계산하게 되므로 ap==bp가 됩니다. a가 음수인 경우 소수점 아래 값은 순 숫자만 표기된 상태이므로 양수 취급으로 되지 않게 소수점 아래 값인 ab에 음수 표기를 남깁니다. {{{#!if as[0]==45 {{{#!if ab="-"+ab }}}}}} 마찬가지로 b가 음수인 경우 b의 소수점 아래 값은 음수이므로 소수점 아래 값인 bb에 음수 표기를 남깁니다. {{{#!if bs[0]==45 {{{#!if bb="-"+bb }}}}}} {{{#!if f=="+" {{{#!if ru=(+au)+(+bu), rb=(+ab)+(+bb) }}}}}} {{{#!if f=="-" 뺄셈은 덧셈의 역연산이고 구조가 단순하므로 덧셈과 뺄셈을 먼저 같이 처리합니다. ru, rb는 각각 정수 값으로 나올 것입니다. {{{#!if ru=(+au)-(+bu), rb=(+ab)-(+bb) }}}}}} 소수점 아래끼리 더한 자릿수가 얼마나 되는지 보기 위해 rb를 문자열로 바꿉니다. {{{#!if this.rb=rb.toString() }}} 문자열로 된 rb의 길이를 rp로 정의합니다. {{{#!if this.rp=rb.length }}} rb가 음수이면 rb의 첫번째(0번 index)의 문자열에는 마이너스(-)가 들어갑니다. 이 때는 rp를 rb의 마이너스 문자열을 세지 않은 자릿수가 되도록 앞에서 정의했던 rb.length에서 1만큼 줄여 정의합니다. ap, bp는 마이너스를 붙이기 전에 값이 고정되어 있으므로 rp처럼 줄일 필요가 없습니다. {{{#!if rb[0]==45 {{{#!if rp=rp-1 }}}}}} ru는 정수이므로 ru가 0보다 크면 곧 ru는 1 이상의 정수이며, 1 이상이면 a+b 또는 a-b가 양수+음수 꼴이 되더라도 소수점 아래 정리를 하면 됩니다. rb를 정리하는 과정에서 ru에서 1을 빌려오거나 ru에 1이 더해질 수도 있습니다. 앞에서 rb를 string으로 바꿨으므로 +rb를 다룹니다. {{{#!if ru>0 {{{#!if +rb>=0 rb가 소수점 아래 자릿수를 초과하여 소수점 위의 수를 계산하게 생겼다면 ap=bp인 상황에서 rp>ap가 됩니다. rb는 첫 숫자가 1인 정수가 되므로 첫 숫자인 1을 삭제한 문자열로 정의합니다. {{{#!if rp>ap {{{#!if ru=ru+1, rb=rb.substr(1, rp-1) }}}}}} rb가 소수점 아래 자릿수를 초과하지 않을 경우 rb를 다시 정의할 필요 없이 그대로 둡니다. {{{#!if rp<=ap }}} }}} rb가 음수가 되는 경우 ru에서 1을 빌려옵니다. 1보다 작은 값에서 1보다 작은 값을 빼므로 -1보다 작을 수 없으며, 소수점 아래 자릿수가 초과되지 않습니다. {{{#!if +rb<0 {{{#!if ru=ru-1 }}} rb의 자릿수인 rp만큼 10을 제곱한 값으로 rb를 재정의한 다음 rb를 다시 문자열로 변환합니다. {{{#!if rb=(+rb)+10**rp }}}{{{#!if rb=rb.toString() }}} }}} 정리과정을 끝냈으면 ru를 string으로 변환합니다. {{{#!if this.ru=ru.toString() }}}}}} ru가 0이 되면 rb의 값이 양수인지 음수인지에 따라 달라집니다. {{{#!if ru==0 {{{#!if +rb>=0 rb가 양수이면서 rb가 자릿수를 초과한 경우 rb는 첫 숫자가 1인 정수가 되므로 첫 숫자인 1을 삭제한 문자열로 정의합니다. {{{#!if rp>ap {{{#!if ru=ru+1, rb=rb.substr(1, rp-1) }}}}}}}}} rb가 음수인 경우 {{{#!if +rb<0 rb가 음수이면서 rb가 자릿수를 초과한 경우 값이 0인 ru에 1을 빼야 합니다. 그리고 rb가 "-"+숫자 꼴이므로 문자열의 1번 index에 해당하는 1을 지워야 합니다. 앞에서 rb가 음수인 경우 rp는 rb의 마이너스(-)가 차지하는 자릿수를 계산하지 않은 값 곧 숫자들이 차지하는 자릿수이므로 substr에서 문자열 길이를 rp-1로 둡니다. {{{#!if rp>ap {{{#!if ru=ru-1, rb="-"+rb.substr(2, rp-1) }}}}}}}}} 정리과정을 끝냈으면 ru를 string으로 변환합니다. {{{#!if this.ru=ru.toString() }}} }}} {{{#!if ru<0 }}} {{{#!if f=="*" 18자리 숫자로 입력할 수 있는 최대 정수는 999,999,999,999,999,999입니다. 다행히 999,999,999,999,999,999*9=8,999,999,999,999,999,991 < long 한계치 9,223,372,036,854,775,807 이라서 a*각 자릿수로 덧셈해볼 수는 있습니다. }}} error code 03 번 : 오버플로 error code 04 번 : 언더플로 error code 05 번 : 0으로 나눌 수 없습니다. ##여기까지 주석(주석 아님) }}}{{{#!if as[0]!=45 @a@}}}{{{#!if as[0]==45 (@a@)}}}{{{#!if f=='+' +}}}{{{#!if f=="-" -}}}{{{#!if f=="*" *}}}{{{#!if f=="/" /}}}{{{#!if bs[0]!=45 @b@}}}{{{#!if bs[0]==45 (@b@)}}}}}} ==# 2-1 #== {{{#!wiki style="font-weight: 300; font-size: 20px" {{{#!if +a>=0 @a@}}}{{{#!if +a<0 (@a@)}}} {{{#!if f == '+' {{{#!if r =(+a)+(+b)+0.0, u=(+a)+(+b) }}}+}}}{{{#!if f == '-' {{{#!if r =(+a)-(+b)+0.0, u=(+a)-(+b) }}}-}}}{{{#!if f == '*' {{{#!if r =((+a)+0.0)*((+b)+0.0), u=(+a)*(+b) }}}×}}}{{{#!if f == '/' {{{#!if r =((+a)+0.0)/((+b)+0.0), u=(+a)/(+b) }}}÷}}} {{{#!if +b>=0 @b@}}}{{{#!if +b<0 (@b@)}}} = {{{#!if u=r-u, d=false ##u : 나누어떨어지는 부분 절삭하기. d : dot 매김 여부 }}}{{{#!if r=r.toString(), u=u.toString() }}}{{{#!if o=0, l=r.length }}}{{{#!if (r!=null)&&(r!="") {{{#!if +o<l ##1 {{{#!if p=r[o] }}}{{{#!if p==45 -}}}{{{#!if p==46 {{{#!if d=true }}}}}}{{{#!if p==48 0}}}{{{#!if p==49 1}}}{{{#!if p==50 2}}}{{{#!if p==51 3}}}{{{#!if p==52 4}}}{{{#!if p==53 5}}}{{{#!if p==54 6}}}{{{#!if p==55 7}}}{{{#!if p==56 8}}}{{{#!if p==57 9}}}{{{#!if o+=1 }}}}}}{{{#!if (o<l)&&(d==false) ##2 {{{#!if p=r[o] }}}{{{#!if p==46 {{{#!if d=true }}}}}}{{{#!if p==48 0}}}{{{#!if p==49 1}}}{{{#!if p==50 2}}}{{{#!if p==51 3}}}{{{#!if p==52 4}}}{{{#!if p==53 5}}}{{{#!if p==54 6}}}{{{#!if p==55 7}}}{{{#!if p==56 8}}}{{{#!if p==57 9}}}{{{#!if o+=1 }}}}}}{{{#!if (o<l)&&(d==false) ##3 {{{#!if p=r[o] }}}{{{#!if p==46 {{{#!if d=true }}}}}}{{{#!if p==48 0}}}{{{#!if p==49 1}}}{{{#!if p==50 2}}}{{{#!if p==51 3}}}{{{#!if p==52 4}}}{{{#!if p==53 5}}}{{{#!if p==54 6}}}{{{#!if p==55 7}}}{{{#!if p==56 8}}}{{{#!if p==57 9}}}{{{#!if o+=1 }}}}}}{{{#!if (o<l)&&(d==false) ##4 {{{#!if p=r[o] }}}{{{#!if p==46 {{{#!if d=true }}}}}}{{{#!if p==48 0}}}{{{#!if p==49 1}}}{{{#!if p==50 2}}}{{{#!if p==51 3}}}{{{#!if p==52 4}}}{{{#!if p==53 5}}}{{{#!if p==54 6}}}{{{#!if p==55 7}}}{{{#!if p==56 8}}}{{{#!if p==57 9}}}{{{#!if o+=1 }}}}}}{{{#!if (o<l)&&(d==false) ##5 {{{#!if p=r[o] }}}{{{#!if p==46 {{{#!if d=true }}}}}}{{{#!if p==48 0}}}{{{#!if p==49 1}}}{{{#!if p==50 2}}}{{{#!if p==51 3}}}{{{#!if p==52 4}}}{{{#!if p==53 5}}}{{{#!if p==54 6}}}{{{#!if p==55 7}}}{{{#!if p==56 8}}}{{{#!if p==57 9}}}{{{#!if o+=1 }}}}}}{{{#!if (o<l)&&(d==false) ##6 {{{#!if p=r[o] }}}{{{#!if p==46 {{{#!if d=true }}}}}}{{{#!if p==48 0}}}{{{#!if p==49 1}}}{{{#!if p==50 2}}}{{{#!if p==51 3}}}{{{#!if p==52 4}}}{{{#!if p==53 5}}}{{{#!if p==54 6}}}{{{#!if p==55 7}}}{{{#!if p==56 8}}}{{{#!if p==57 9}}}{{{#!if o+=1 }}}}}}{{{#!if (o<l)&&(d==false) ##7 {{{#!if p=r[o] }}}{{{#!if p==46 {{{#!if d=true }}}}}}{{{#!if p==48 0}}}{{{#!if p==49 1}}}{{{#!if p==50 2}}}{{{#!if p==51 3}}}{{{#!if p==52 4}}}{{{#!if p==53 5}}}{{{#!if p==54 6}}}{{{#!if p==55 7}}}{{{#!if p==56 8}}}{{{#!if p==57 9}}}{{{#!if o+=1 }}}}}}{{{#!if (o<l)&&(d==false) ##8 {{{#!if p=r[o] }}}{{{#!if p==46 {{{#!if d=true }}}}}}{{{#!if p==48 0}}}{{{#!if p==49 1}}}{{{#!if p==50 2}}}{{{#!if p==51 3}}}{{{#!if p==52 4}}}{{{#!if p==53 5}}}{{{#!if p==54 6}}}{{{#!if p==55 7}}}{{{#!if p==56 8}}}{{{#!if p==57 9}}}{{{#!if o+=1 }}}}}}{{{#!if (o<l)&&(d==false) ##9 {{{#!if p=r[o] }}}{{{#!if p==46 {{{#!if d=true }}}}}}{{{#!if p==48 0}}}{{{#!if p==49 1}}}{{{#!if p==50 2}}}{{{#!if p==51 3}}}{{{#!if p==52 4}}}{{{#!if p==53 5}}}{{{#!if p==54 6}}}{{{#!if p==55 7}}}{{{#!if p==56 8}}}{{{#!if p==57 9}}}{{{#!if o+=1 }}}}}}{{{#!if (o<l)&&(d==false) ##10 {{{#!if p=r[o] }}}{{{#!if p==46 {{{#!if d=true }}}}}}{{{#!if p==48 0}}}{{{#!if p==49 1}}}{{{#!if p==50 2}}}{{{#!if p==51 3}}}{{{#!if p==52 4}}}{{{#!if p==53 5}}}{{{#!if p==54 6}}}{{{#!if p==55 7}}}{{{#!if p==56 8}}}{{{#!if p==57 9}}}{{{#!if o+=1 }}}}}}{{{#!if (o<l)&&(d==false) ##11 {{{#!if p=r[o] }}}{{{#!if p==46 {{{#!if d=true }}}}}}{{{#!if p==48 0}}}{{{#!if p==49 1}}}{{{#!if p==50 2}}}{{{#!if p==51 3}}}{{{#!if p==52 4}}}{{{#!if p==53 5}}}{{{#!if p==54 6}}}{{{#!if p==55 7}}}{{{#!if p==56 8}}}{{{#!if p==57 9}}}{{{#!if o+=1 }}}}}}{{{#!if (o<l)&&(d==false) ##12 {{{#!if p=r[o] }}}{{{#!if p==46 {{{#!if d=true }}}}}}{{{#!if p==48 0}}}{{{#!if p==49 1}}}{{{#!if p==50 2}}}{{{#!if p==51 3}}}{{{#!if p==52 4}}}{{{#!if p==53 5}}}{{{#!if p==54 6}}}{{{#!if p==55 7}}}{{{#!if p==56 8}}}{{{#!if p==57 9}}}{{{#!if o+=1 }}}}}}{{{#!if (o<l)&&(d==false) ##13 {{{#!if p=r[o] }}}{{{#!if p==46 {{{#!if d=true }}}}}}{{{#!if p==48 0}}}{{{#!if p==49 1}}}{{{#!if p==50 2}}}{{{#!if p==51 3}}}{{{#!if p==52 4}}}{{{#!if p==53 5}}}{{{#!if p==54 6}}}{{{#!if p==55 7}}}{{{#!if p==56 8}}}{{{#!if p==57 9}}}{{{#!if o+=1 }}}}}}{{{#!if (o<l)&&(d==false) ##14 {{{#!if p=r[o] }}}{{{#!if p==46 {{{#!if d=true }}}}}}{{{#!if p==48 0}}}{{{#!if p==49 1}}}{{{#!if p==50 2}}}{{{#!if p==51 3}}}{{{#!if p==52 4}}}{{{#!if p==53 5}}}{{{#!if p==54 6}}}{{{#!if p==55 7}}}{{{#!if p==56 8}}}{{{#!if p==57 9}}}{{{#!if o+=1 }}}}}}{{{#!if (o<l)&&(d==false) ##15 {{{#!if p=r[o] }}}{{{#!if p==46 {{{#!if d=true }}}}}}{{{#!if p==48 0}}}{{{#!if p==49 1}}}{{{#!if p==50 2}}}{{{#!if p==51 3}}}{{{#!if p==52 4}}}{{{#!if p==53 5}}}{{{#!if p==54 6}}}{{{#!if p==55 7}}}{{{#!if p==56 8}}}{{{#!if p==57 9}}}{{{#!if o+=1 }}}}}}{{{#!if (o<l)&&(d==false) ##16 {{{#!if p=r[o] }}}{{{#!if p==46 {{{#!if d=true }}}}}}{{{#!if p==48 0}}}{{{#!if p==49 1}}}{{{#!if p==50 2}}}{{{#!if p==51 3}}}{{{#!if p==52 4}}}{{{#!if p==53 5}}}{{{#!if p==54 6}}}{{{#!if p==55 7}}}{{{#!if p==56 8}}}{{{#!if p==57 9}}}{{{#!if o+=1 }}}}}}{{{#!if (o<l)&&(d==false) ##17 {{{#!if p=r[o] }}}{{{#!if p==46 {{{#!if d=true }}}}}}{{{#!if p==48 0}}}{{{#!if p==49 1}}}{{{#!if p==50 2}}}{{{#!if p==51 3}}}{{{#!if p==52 4}}}{{{#!if p==53 5}}}{{{#!if p==54 6}}}{{{#!if p==55 7}}}{{{#!if p==56 8}}}{{{#!if p==57 9}}}{{{#!if o+=1 }}}}}}{{{#!if (o<l)&&(d==false) ##18 {{{#!if p=r[o] }}}{{{#!if p==46 {{{#!if d=true }}}}}}{{{#!if p==48 0}}}{{{#!if p==49 1}}}{{{#!if p==50 2}}}{{{#!if p==51 3}}}{{{#!if p==52 4}}}{{{#!if p==53 5}}}{{{#!if p==54 6}}}{{{#!if p==55 7}}}{{{#!if p==56 8}}}{{{#!if p==57 9}}}{{{#!if o+=1 }}}}}}{{{#!if (o<l)&&(d==false) ##19 {{{#!if p=r[o] }}}{{{#!if p==46 {{{#!if d=true }}}}}}{{{#!if p==48 0}}}{{{#!if p==49 1}}}{{{#!if p==50 2}}}{{{#!if p==51 3}}}{{{#!if p==52 4}}}{{{#!if p==53 5}}}{{{#!if p==54 6}}}{{{#!if p==55 7}}}{{{#!if p==56 8}}}{{{#!if p==57 9}}}{{{#!if o+=1 }}}}}}{{{#!if (o<l)&&(d==false) ##20 {{{#!if p=r[o] }}}{{{#!if p==46 {{{#!if d=true }}}}}}{{{#!if p==48 0}}}{{{#!if p==49 1}}}{{{#!if p==50 2}}}{{{#!if p==51 3}}}{{{#!if p==52 4}}}{{{#!if p==53 5}}}{{{#!if p==54 6}}}{{{#!if p==55 7}}}{{{#!if p==56 8}}}{{{#!if p==57 9}}}{{{#!if o+=1 }}}}}}{{{#!if o=0, l=u.length }}}{{{#!if u[0]==45 ##음수로 마이너스가 표시되면 넘기기 {{{#!if o+=1 }}}}}}{{{#!if l-o>2 ##소수점이 나오면 "0."으로 2자리 차지하므로 소수점 표기. {{{#!if o+=1 ##일의 자리 넘기기 }}}{{{#!if (u[o+1]!=48)||(u[o+2]!=48)||(u[o+3]!=48)||(u[o+4]!=48)||(u[o+5]!=48)||(u[o+6]!=48) ##".000000"은 표기하지 않음. 소수점 표기 .{{{#!if o+=1 }}}}}}}}}{{{#!if (o<l)&&(d==true)&&((u[o+1]!=48)||(u[o+2]!=48)||(u[o+3]!=48)||(u[o+4]!=48)||(u[o+5]!=48)) ##1 {{{#!if p=u[o] }}}{{{#!if p==48 0}}}{{{#!if p==49 1}}}{{{#!if p==50 2}}}{{{#!if p==51 3}}}{{{#!if p==52 4}}}{{{#!if p==53 5}}}{{{#!if p==54 6}}}{{{#!if p==55 7}}}{{{#!if p==56 8}}}{{{#!if p==57 9}}}{{{#!if o+=1 }}}}}}{{{#!if (o<l)&&(d==true)&&((u[o+1]!=48)||(u[o+2]!=48)||(u[o+3]!=48)||(u[o+4]!=48)) ##2 {{{#!if p=u[o] }}}{{{#!if p==48 0}}}{{{#!if p==49 1}}}{{{#!if p==50 2}}}{{{#!if p==51 3}}}{{{#!if p==52 4}}}{{{#!if p==53 5}}}{{{#!if p==54 6}}}{{{#!if p==55 7}}}{{{#!if p==56 8}}}{{{#!if p==57 9}}}{{{#!if o+=1 }}}}}}{{{#!if (o<l)&&(d==true)&&((u[o+1]!=48)||(u[o+2]!=48)||(u[o+3]!=48)) ##3 {{{#!if p=u[o] }}}{{{#!if p==48 0}}}{{{#!if p==49 1}}}{{{#!if p==50 2}}}{{{#!if p==51 3}}}{{{#!if p==52 4}}}{{{#!if p==53 5}}}{{{#!if p==54 6}}}{{{#!if p==55 7}}}{{{#!if p==56 8}}}{{{#!if p==57 9}}}{{{#!if o+=1 }}}}}}{{{#!if (o<l)&&(d==true)&&((u[o+1]!=48)||(u[o+2]!=48)) ##4 {{{#!if p=u[o] }}}{{{#!if p==48 0}}}{{{#!if p==49 1}}}{{{#!if p==50 2}}}{{{#!if p==51 3}}}{{{#!if p==52 4}}}{{{#!if p==53 5}}}{{{#!if p==54 6}}}{{{#!if p==55 7}}}{{{#!if p==56 8}}}{{{#!if p==57 9}}}{{{#!if o+=1 }}}}}}{{{#!if (o<l)&&(d==true)&&(u[o+1]!=48) ##5 {{{#!if p=u[o] }}}{{{#!if p==48 0}}}{{{#!if p==49 1}}}{{{#!if p==50 2}}}{{{#!if p==51 3}}}{{{#!if p==52 4}}}{{{#!if p==53 5}}}{{{#!if p==54 6}}}{{{#!if p==55 7}}}{{{#!if p==56 8}}}{{{#!if p==57 9}}}{{{#!if o+=1 }}}}}}{{{#!if (o<l)&&(d==true) ##6 {{{#!if p=u[o] }}}{{{#!if p==48 ##"0" 미표기 }}}{{{#!if p==49 1}}}{{{#!if p==50 2}}}{{{#!if p==51 3}}}{{{#!if p==52 4}}}{{{#!if p==53 5}}}{{{#!if p==54 6}}}{{{#!if p==55 7}}}{{{#!if p==56 8}}}{{{#!if p==57 9}}}{{{#!if o+=1 }}}}}}}}}}}}