RC522, storing and retrieving int values in MIFARE card

I've just started again with a halted cash register project for the kids, where I'm using a barcode scanner to scan items, using a touch screen shield for buttons and listing the items and so on. All of that is coming together, but I would like to use RFID cards as "credit cards", so the kids can have their own card to pay with. I'm planning to make a "cash machine" kind of thing to reload cash on the cards with (if they do their duties.... :slight_smile: )
Anyway, I've tried many example codes to handle RFID cards, and storing and retrieving text is no problem, my problems start when I try to sneak in int values to the cards. I'm a Java guy with very limited skills even at Java, and the C/C++ datatypes are choking me. I guess it's as easy as anything, when you know how to do it, but I don't.
I've found a fairly straightforward code I've been trying to edit, but with no luck.

The code is to long to post here, but it's found here ---> Arduino Cloud

Is there an easy way (that even I can understand) of getting an unsigned int (i don't need negative numbers, so I guess that should make it even easier, as the unsigned int is the same size as the byte...) into that blockcontent value, store it in the card, and retrieve it, still as an integer. If I hard code the value in the above code, it works, at least it prints the correct value with Serial.write(), but i seem to be missing some basics on how to make this work with an int variable at both ends.

Any help is appreciated, as long as I understand it. :slight_smile:

Have you look at the read and write examples ?

You just write a blob of data after authentication so you could pass the address of your variable and size of your variable in bytes and those byte would go on the card as long as it fits. 2 or 4 bytes would be no pb