Due to increasing spam attacks, forum registrations are currently paused to keep our community safe and spam-free. Come hang out and stay connected with us on the SimHub Discord: https://discord.com/invite/nBBMuX7!

Catch you on Discord — and thanks for understanding!
What function to fo...
 
Notifications
Clear all

What function to format "55.0 L" into "55.0" ?

4 Posts
2 Users
0 Reactions
1,585 Views
(@fonsuak)
Eminent Member
Joined: 4 years ago
Posts: 11
Topic starter  

In order to create an indicator for the fuel used, I need to get a numeric value out of [GameRawData.SessionData.CarSetup.Chassis.Rear.FuelLevel] which atm it's sitting at "55.0 L" and in order to operate with it, I need it formatted to "55.0"

Is there any function I can use to achieve this format of data that is given with its units?

Thank you all very much for your time! 


   
Quote
(@romainrob)
Honorable Member
Joined: 6 years ago
Posts: 530
 

Hi,
Try: replace([GameRawData.SessionData.CarSetup.Chassis.Rear.FuelLevel], ' L', '')


   
ReplyQuote
(@fonsuak)
Eminent Member
Joined: 4 years ago
Posts: 11
Topic starter  

@romainrob the man himself!

Thank you very much man, that totally worked. Never used that function and it truly opens a ton of possibilities for me!

Merci beaucoup!


   
ReplyQuote
(@romainrob)
Honorable Member
Joined: 6 years ago
Posts: 530
 

@fonsuak De rien 😉


   
ReplyQuote
Share:
📄 Terms & Conditions | 📑 Privacy Policy