eraeco / pay

Checkard is a peer-to-peer check payment system for ERA PAY.
MIT License
4 stars 0 forks source link

enable auto-filling amounts with long form version of amount #17

Closed jazzyjackson closed 4 weeks ago

amark commented 1 month ago

WOAAAAAAAH wait was this GPT? :P NO DEPENDENCY AND IT WORKS. Yaycakes. SO FUN, so happy.

Problem: does not work for 3,451.21 does work for 3451.21 ... fix should just be .replace(',','') early on, but don't want to mess with git conflicts. Does not work for 200 but does work for 200.00.

Note: For long amounts, text starts to overflow... prob can fix (A) set to wrap, center align to not wrap into bank address or (B) combine with #18 and do a quick .length check and if larger than some length (or better, use it as some ratio, like your log10 idea but different ratio of course) to update the CSS with X% smaller font size.

amark commented 1 month ago

finish this finish this finish this i wanna be able to meeeeerge so fun yay much wow

cloudflare-pages[bot] commented 1 month ago

Deploying pay with  Cloudflare Pages  Cloudflare Pages

Latest commit: 593a75a
Status: ✅  Deploy successful!
Preview URL: https://be56c9c5.pay-cwc.pages.dev
Branch Preview URL: https://feature-autoconvert.pay-cwc.pages.dev

View logs

jazzyjackson commented 1 month ago

Is not GPT, is an old stack overflow, forgot to add the attribution to comply with CC-SA license but its there now.

I'll go ahead and be optimistic and use .replaceAll(',','') for cases of multiple commas

Do you want it to autofill the last '.00' if a user leaves it off? I decided to include it in the regex so the conversion to english only happens once a full amount is entered. I could make it so the english works when '22' is entered instead of '22.00' but its a smidge more code to check if the '.00' was left off and modify the user's entry but I didn't want to assume the intent.

I'll make a separate pull request that auto-scales text for both the amounts field and the endorsement.

amark commented 1 month ago

Great.

Yes, if someone blurs with no decimals, like 20, then auto add .00 good idea.

Great.

amark commented 4 weeks ago

!!!!!!!!!!!!!!!!!!!!!!! 🥰 🥰 🥰 🥰 🥰 🥰

This is so delightful. Gosh. Idk why I'm obsessing over it so much. It's a completely unnecessary thing but I think that's why it's like... Yeah!!!! It just adds delight. So cool. Merging!!!!!!! Really proud to show this one off.

jazzyjackson commented 4 weeks ago

Closes #6