The best way to encode an amount in an on-chain bitcoin QR code is to generate a QR code from a BIP 21 URI scheme.
For example, if you wanted the payer to send 1 bitcoin to address
175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W, you would encode the following string into a QR code and display it to the payer.
bitcoin:175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W?amount=1.0
Any payer using a BIP 21 compatible wallet will be able to scan a QR code of this format. It's important to be aware that this does NOT force the payer to pay this amount. This amount field is merely a suggestion to help wallets autofill or suggest an amount to pay. In other words, when accepting bitcoin payments you must still check your wallet software to make sure that the correct amount was payed, even if you encode it in a BIP 21 URI scheme.
View full BIP 21 scheme options here:
https://github.com/bitcoin/bips/blob/master/bip-0021.mediawiki
View a non-comprehensive list of supported wallets/services here:
https://bitcoinqr.dev/
If you would like a stricter payment flow, I suggest you look into supporting BOLT-11 invoices (which can be wrapped in a BIP 21 URI) using the lightning network. Lightning invoices require that the payer sends the exact specified amount for the payment to go through. Although accepting bitcoin lightning payments does require more infrastructure and maintenance overhead, it offers a superior receiving experience in this regard.
View BOLT 11 spec here: https://github.com/lightning/bolts/blob/master/11-payment-encoding.md