Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Developing U++ » U++ Developers corner » Value with type float
Re: Value with type float [message #58293 is a reply to message #58289] Tue, 12 April 2022 09:26 Go to previous messageGo to previous message
Tom1
Messages: 1302
Registered: March 2007
Ultimate Contributor
mirek wrote on Mon, 11 April 2022 17:52
Tom1 wrote on Sat, 02 April 2022 13:31
No problem... I trust you will soon come up with some astonishingly smart three line solution for the task! Smile

Best regards,

Tom


Nothing too smart for now, but I have added ConvertFloat and EditFloat.

The jury is still out for float in Value.... do not want to do that now. It feels like while it fixes some issues (e.g. Value->JSON conversion when the values went through float precision), there might be many caveats.


Hi Mirek,

Thanks! EditFloat works fine now. However, there are a couple of things more. First, could you add float operator to Value for easy reading of EditFloat:
operator float() const           { return Is(DOUBLE_V) ? (float)GetSmallRaw<double>() : (float)GetOtherDouble(); }

Second, can you add EditFloatSpin and EditFloatNotNullSpin variants?:
typedef WithSpin<float, EditFloat>			 EditFloatSpin;
typedef WithSpin<float, EditFloatNotNull>	 EditFloatNotNullSpin;

// And then some magic to make those two working and visible in layout editor.

Thanks and best regards,

Tom
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Build U++ with CMake and Clang Example
Next Topic: A temporary solution to garbled code in U++applications built through MSVC
Goto Forum:
  


Current Time: Thu May 01 01:28:27 CEST 2025

Total time taken to generate the page: 0.01189 seconds