익명 사용자
로그인하지 않음
토론
기여
계정 만들기
로그인
누리위키
검색
틀:단위 변환/numdisp
편집하기
누리위키, 온 누리의 백과사전
이름공간
틀
토론
더 보기
더 보기
문서 행위
읽기
편집
역사
경고:
로그인하지 않았습니다. 편집을 하면 IP 주소가 공개되게 됩니다.
로그인
하거나
계정을 생성하면
편집자가 사용자 이름으로 기록되고, 다른 장점도 있습니다.
스팸 방지 검사입니다. 이것을 입력하지
마세요
!
<noinclude><!-- --============================================================ -- Display a number, with optional fraction part: 6+3/8 --============================================================ -- (see NOTES at bottom) -- --></noinclude>{{#if:{{#titleparts:{{{1|-1200-3~118}}}|1|2}} |{{단위 변환/numdisp/frac |{{{1|-1200-3/118}}}|{{#titleparts:{{{1|-1200-3/118}}}|1|1}}|{{#titleparts:{{{1|-1200-3/118}}}|1|2}}}}<!--split at "/" --else-->|{{#ifexpr:{{{1|-14000.00}}} < 0 |<!--then re-build negative number (see NOTE Z4 below) -->{{formatnum: {{padright:−<!--&minus-->{{#expr:-{{{1|-14000.00}}} }}<!--endexpr --put decimal if needed-->{{ #ifexpr:{{{1|-14000.00}}}0={{{1|-14000.00}}} and {{{1|-14000.00}}}=floor( {{{1|-14000.00}}} )|.}}<!-- -->|{{strlen_short|{{{1|-14000.00}}}|}}<!--endstrlen_short -->|0}}<!--endpadright end-zeroes "0" to original length -->}}<!--endformatnum else-->|{{formatnum: {{{1|6000.500}}} }}}}<!--endif {1}<0 -->}}<noinclude><!--endif {#titleparts..} -------------------------------------------------------------- --NOTES: -- [ These comments are skipped by <noinclude> and not sent -- in formatted Internet pages, only during edit. ] -- --NOTE A1: This template processes a number, for display, by -- checking to display a fraction part ("/"), else it -- will check for negative to display a unicode &minus -- and {{formatnum:{{#expr:abs( {{{1|-6000}}} )}}}} such -- as "-6000" with a full minus sign rather than hyphen. -- In 99% of Wikipedia usage, there are no fractions. -- --NOTE D2: The check, for fraction parts, uses parser-function -- #titleparts to split the number at "/" (if any) and -- then checks part 2 (the denominator, after the slash) -- to trigger use of {{단위 변환/numdisp/fracparts}}. Hence, -- #if: {{#titleparts:{{{1|6+3/8}}}|1|2}} -- will be true if a denominator exists (such as "8"). -- --NOTE N3: This template uses minimal expansion depth of the -- if-else logic by checking for "/" before invoking the -- nested subtemplate {{단위 변환/numdisp/fracparts}}. The -- check for a negative number increases the nesting depth -- by 1 level to apply abs({1}) in a nested {#expr:} parser -- function, to use the absolute value of the amount {1}. -- --NOTE Z4: Any end-zeroes on a decimal are preserved by not -- using positive amounts in an expression, and for rare -- negative amounts, the &minus with inverse -{1} is padded -- by {padright:} with end-zeroes "0" to {strlen_short} but -- uses #ifexpr:{1}0={1} and floor({1})={1} to put ".". -- So, {strlen_short} keeps minimal expansion depth of +2. -- -- WARNING: *** DO NOT DELETE COMMENTS FROM THIS TEMPLATE *** -- Unless these comments are readily available, people -- might tinker with the coding (or rename templates), -- in hopes to clarify operation because these comments -- were not nearby to explain the issues. Having these -- comments only on a doc-page increases the danger of -- explanations no longer matching the current coding. -- UPDATE these comments to match changes to the template. -- UPDATE the HISTORY during major changes (not typos). -- -------------------------------------------------------------- --HISTORY: --03Apr09 Created by [[User:Jimp]] on English Wikipedia. --19Nov10 Invokes subtemplate only if has denominator (at "/"). --19Nov10 Put NOTES comments to explain template coding. --19Nov10 Put HISTORY comments to log major changes. --19Nov10 Put all parameters on 1 line to avoid newline "2^ /3" --20Nov10 Linked {Documentation} to hold any interwiki links. --12Feb11 Shows Unicode &minus ("−") for negative numbers. --17Feb11 Used {padright:} to re-add end-zeroes on negatives. --17Feb11 Used #ifexpr:{1}0={1} and floor({1})={1}, to put "." -- ** Add interwiki links to /doc subpage to avoid changes here ** -- -->{{Documentation}} </noinclude>
요약:
누리위키에서의 모든 기여는 크리에이티브 커먼즈 저작자표시-비영리-동일조건변경허락 라이선스로 배포된다는 점을 유의해 주세요(자세한 내용에 대해서는
누리위키:저작권
문서를 읽어주세요). 만약 여기에 동의하지 않는다면 문서를 저장하지 말아 주세요.
또한, 직접 작성했거나 퍼블릭 도메인과 같은 자유 문서에서 가져왔다는 것을 보증해야 합니다.
저작권이 있는 내용을 허가 없이 저장하지 마세요!
취소
편집 도움말
(새 창에서 열림)
이 문서에서 사용한 틀:
틀:Documentation
(
편집
)
틀:Strlen short
(
편집
)
틀:틀 설명문서
(
편집
)
틀:틀 설명문서/설명공간
(
편집
)
틀:틀 설명문서/틀문서
(
편집
)
둘러보기
둘러보기
대문
최근 바뀜
위키방
임의의 문서로
도움말
연습장
위키 도구
위키 도구
특수 문서 목록
문서 도구
문서 도구
사용자 문서 도구
더 보기
여기를 가리키는 문서
가리키는 글의 최근 바뀜
문서 정보
문서 기록