It is currently April 24th, 2024, 8:28 pm

Looking for a Unit Conversion tool

Get help with creating, editing & fixing problems with skins
User avatar
balala
Rainmeter Sage
Posts: 16168
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Looking for a Unit Conversion tool

Post by balala »

CoffeeJoe wrote: November 13th, 2019, 2:58 am Balala's solution is exactly what I was looking for, I want to understand how I can enter data and have a skin run a calculation or a lookup on that data and return a result.
I'm glad if my code match your needs.
If you couldn't figure out how to use it (???) so far, first you have to choose what conversion do you need: from Celsius to Fahrenheit or vice-versa, from Fahrenheit to Celsius (obviously clicking the appropriate radio button). Then click the already shown conversion (for instance 0C = 32F) and this opens the field where you can add the desired temperature which you want to convert. Enter it (and hit Enter on your keyboard) and the conversion is done automatically.
I just needed a confirmation that this code is what you want. Further sections can be added, to can make the other conversions as well (for instance from kg to lbs or vice-versa). Do you want me to add those sections?
User avatar
CoffeeJoe
Posts: 48
Joined: November 6th, 2019, 4:19 am

Re: Looking for a Unit Conversion tool

Post by CoffeeJoe »

Thanks, yes your code is exactly what I was looking for.
No additional sections needed :thumbup:

As for it not working, I can't seem to make any skin take my input. I select the field, it opens the "editable" field, I put in the new value and press enter - edit field closes skin still displays old value.
I see this with Weather Location Codes and similar fields in all skins. I end up having to manually open the file and add the correct value.
I've gotten used to it, its not your code, its something about my setup.

I'm ok either way, thanks again.
User avatar
balala
Rainmeter Sage
Posts: 16168
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Looking for a Unit Conversion tool

Post by balala »

CoffeeJoe wrote: November 14th, 2019, 1:51 am No additional sections needed :thumbup:
I'm surprised because in the initial request you said you want to:
CoffeeJoe wrote: November 10th, 2019, 1:13 pm
  • Enter degrees in Celsius and it displays the value in Fahrenheit
  • Enter the weight in Metric and it returns the Imperial value
  • Enter Tbsp. and it'll tell me how many tsp. that is.
But the posted code converts only the temperature. Weight and Tbsp are not converted. Don't you want to convert them any more?
CoffeeJoe wrote: November 14th, 2019, 1:51 am As for it not working, I can't seem to make any skin take my input. I select the field, it opens the "editable" field, I put in the new value and press enter - edit field closes skin still displays old value.
I see this with Weather Location Codes and similar fields in all skins. I end up having to manually open the file and add the correct value.
I've gotten used to it, its not your code, its something about my setup.
I'm surprised again, because if i click the shown conversion (0C = 32F), the input field opens. If I enter a new value and hit Enter, the skin makes immediately the conversion. For instance if I enter 30, I get the appropriate temperature in Fahrenheit degrees: 30C = 86F. Have you changed anything in the code? Or you've moved the code into a larger skin?
If none, please pack the whole config where you have the skin and upload it, to can check.
User avatar
Mor3bane
Posts: 943
Joined: May 7th, 2016, 7:32 am

Re: Looking for a Unit Conversion tool

Post by Mor3bane »

Converter 3.0.rar
You *might* be interested in this API tool I made - then I just shortcut it with whatever widget is convenient.
You do not have the required permissions to view the files attached to this post.
My DevArt Gallery

There are many ways to be different - there is only one way to be yourself - be amazing at it

The law of averages says what it means; even if you get everything right, you will get something wrong. Therefore; self managing error trapping initiates another set of averages - amongst the errors, some of them will not be errors, instead those instances will appear to be "luck". One cannot complain of the 'appearance' of 'infinite regress of causation', even if it does not have a predictable pattern, only that it requires luck to achieve.