Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing leading zeros #66

Open
Secarius opened this issue Oct 27, 2023 · 1 comment
Open

Missing leading zeros #66

Secarius opened this issue Oct 27, 2023 · 1 comment

Comments

@Secarius
Copy link

Hi, how can i display the leading zeros?
I have a tag with 10 digits (Wiegand34) and i would like to get the leading zeros printed:

Instead of: HEX = F225C, DECIMAL = 991836, Type W34
I would like to have it like this: HEX = 000F225C, DECIMAL = 0000991836, Type W34

So that the Output would be the same length every time:
Wiegand1 HEX = DF125A85, DECIMAL = 3742521989, Type W34

Would that be possible?

@jpliew
Copy link
Collaborator

jpliew commented Oct 29, 2023

Hi,

Please refer to printf function or this link https://www.w3resource.com/c-programming-exercises/c-snippets/printing-with-leading-0s-in-c.php

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants