Skip to content
This repository has been archived by the owner on Dec 24, 2023. It is now read-only.

Set float or double value to NextionText? #38

Open
fedorenkoalex opened this issue Oct 30, 2017 · 1 comment
Open

Set float or double value to NextionText? #38

fedorenkoalex opened this issue Oct 30, 2017 · 1 comment

Comments

@fedorenkoalex
Copy link

fedorenkoalex commented Oct 30, 2017

Hi. I see that text can be set to NextionText as char[] or int value only. What about float?

P.S. I did not find any solution for Nextion displays for this in C++. For this now I use this code.
void writeFloatToDisplay(NextionText target, double value) { char buffer[10]; dtostrf(value, 5, 2, buffer); target.setText(buffer); }

@DanNixon
Copy link
Owner

That seems the best option. If you wanted to wrap that in another function on INextionNumericalValued I'd happily accept a PR.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants