Skip to content

Conversation

@zjs81
Copy link

@zjs81 zjs81 commented Nov 15, 2025

Use strtof for improved precision and add ftoa3 function for formatting floats with three decimal places in TxtDataHelpers to fix display issue in app and repeater config ui in web

REPO:

  1. Flash a repeater
  2. Connect over lora
  3. Set bw to 42.7 KHZ

It will revert back due to converting a double to a float.

REPO2:
1.Flash Repeater
2. Apply float fix
3. Set to say 20.8
4. try to get value via app or web cli repeater config It wil show blank because it doesnt return a good value. It would be something like 20.7999992 which the app and web apps dont like so the ftoa3 rounds it and returns a 3 decimal point float

The ftoa3 is only applied to the bw string return. I tested all the BW options and they appear and work as they should. Also testing settings different frequencies and it works as it should.

strtof() is safer and more predictable than atof(), avoids silent parsing bugs, avoids locale issues, is faster, smaller, and gives more accurate float results

…cision and add ftoa3 function for formatting floats with three decimal places in TxtDataHelpers to fix display issue in app and repeater config ui in web

REPO:
1. Flash a repeater
2. Connect over lora
3. Set bw to 42.7 KHZ

It will revert back due to converting a double to a float.

REPO2:
1.Flash Repeater
2. Apply float fix
3. Set to say 20.8
4. try to get value via app or web cli repeater config
It wil show blank because it doesnt return a good value. It would be something like 20.7999992 which the app and web apps dont like so the ftoa3 rounds it and returns a 3 decimal point float
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant