FloatString is haunting me again. Help or sugjestion..
grasshopper
Posts: 438
I am trying to conjure up some type of method that can handle the "width" in FloatToFormat listed in the FloatString object. My problem is that I am sending data Via the FullDuplexSerial object like below and the structure of the data being sent is not the consistency I must have.
This is fine as long as my number is 100.00. The problem is when my number changes to 50.23 then there is a space before the 5.
Like this
I am trying to get this
So far I have tryed to write methods to calculate the necessary number for X in --> ser.str(strings.FloatToFormat(Data,X,4)) But no luck so far.
Any ideas ?
ser.str(string("Current - ")) ser.str(strings.FloatToFormat(Data,8,4)) ser.str(String(" C"))
This is fine as long as my number is 100.00. The problem is when my number changes to 50.23 then there is a space before the 5.
Like this
Current - 100.00 C Current - 50.23 C
I am trying to get this
Current - 100.00 C Current - 50.23 C
So far I have tryed to write methods to calculate the necessary number for X in --> ser.str(strings.FloatToFormat(Data,X,4)) But no luck so far.
Any ideas ?
Comments
"'' leading blank fill is used"
At this bottom is this code:
Try commenting them out.