pull down to refresh
53 sats \ 6 replies \ @kr 28 Dec 2022 \ on: What are you working on? bitcoin
This weekend I used ChatGPT to build an MVP of an Sats <> USD calculator on Stack Sats.
https://www.stacksats.how/convert-sats
For someone who doesn’t know any Javascript at all, ChatGPT is an insanely valuable tool.
I’m still working out some small formatting issues that ChatGPT is struggling with:
-
Trying to figure out how to get comma separators to appear in the input and output numbers (I’m using the ‘toLocaleString’ method without much luck)
-
Trying to figure out how to limit the number of digits entered to prevent overflow
-
Trying to figure out how to build an instant swap button so that someone can seamlessly change the input currency from sats to USD
If there are any javascript experts here that can point me in the right direction on any of these, that would be huge!
Are you already using
type="number"
with your <input>
? Maybe step
can help here, however, haven't tested it yet.max
and min
should definitely fix this:Trying to figure out how to limit the number of digits entered to prevent overflow
Running short on time, will check when I am back :)
reply
this worked great, just set the maximum character length to 10. thanks!
reply
What about the decimals points? You got it working?
reply
yup, working correctly now 👌🏻
reply
Awesome, let us know if there is anything else we can help you with.
I like helping people since questions like this motivate me to challenge and consolidate my existing knowledge
Or even learn something new myself
reply
appreciate it, will do!
reply