Nodyn:Hex2dec
Neidio i'r panel llywio
Neidio i'r bar chwilio
![]() | This template employs intricate features of template syntax.
You are encouraged to familiarise yourself with its setup and parser functions before editing the template. If your edit causes unexpected problems, please undo it quickly, as this template may appear on a large number of pages. Remember that you can conduct experiments, and should test all improvements, in either the general Template sandbox or your user space before changing anything here. |
Usage[golygu cod y dudalen]
Works for all values in the range 0x00–0xFFFFFFFF.
- {{hex2dec|0x0000}} → 0
- {{hex2dec|0xA0}} → 0
- {{hex2dec|0x7C0}} → 0
- {{hex2dec|0xFFFF}} → 0
- {{hex2dec|0x845FED}} → 0
- {{hex2dec|0x75BCD15}} → 0
- {{hex2dec|0xDEADBEEF}} → 0
- {{hex2dec|0xFFFFFFFF}} → 0
The template also accepts lowercase and padded hexadecimals with or without the prefix "0x":
- {{hex2dec|0xa0}} → 0
- {{hex2dec|a0}} → 0
- {{hex2dec|0x00A0}} → 0
- {{hex2dec|A0}} → 0
Technical details[golygu cod y dudalen]
This template works in conjunction with the following subtemplates:
- {{Hex2dec/main}}: does the actual multiplication and addition to create a decimal number.
- {{Hex2dec/1}}: returns the length of the hexadecimal string.
- {{Hex2dec/2}}: converts individual hexadecimal characters into their decimal equivalent.
See also[golygu cod y dudalen]
Mae'r ddogfennaeth uchod wedi ei thrawsgynnwys o Nodyn:Hex2dec/doc. (golygu | hanes) Gall golygyddion arbrofi yn y tudalennau pwll tywod (creu | drych) a testcases (creu). Os gwelwch yn dda, ychwanegwch gategorïau a rhyngwicis at yr is-dudalen /doc. Is-dudalennau'r nodyn hwn. |