jerodev

jerodev does not currently provide support for this item.

11 comments found.

Demo Preview not work “Website under review”.

Preview and documentation is online again.

Yes, I’m sorry. I accidentally let my domain expire so I have none at the moment, but I’m working on a solution.

Ok, seems that you have to delete the filled in areas if you want to do another convertion. Tried it several times, and the only way that they new conversion showed up was if I cleared the forms first. Otherwise look like a nice conversion system.

Do you mean the example? The calculation is done using ajax when a combobox is chaged. :)

Hey there, thank for the script it was easy to setup. suggestion, time zone conversion would be nice

Thank you for the idea. I will see what I can do. :)

Even if you add it under another file I would still buy it, PM me if you do

This looks very useful for educational type websites!

I have an idea: Maybe there could be a way to view the mathematical equation used to show the conversion. Can this be done and if so, how?

It’s a nice work!

 

Actually to update the values it is necessary change manually the units.

It would be possible to have a dynamic input? To put a new value in the input tag, and after pressing return the valor would be automatically converted.

 

Thanks in advance.

Yes you can do this by adding an event to the textbox. Here is an example how to do this with jQuery: http://stackoverflow.com/questions/6524288/jquery-event-for-user-pressing-enter-in-a-textbox

Jerodev,

Thanks a lot for the reply, i will try soon,

regards

1. In length, if I enter Foot, then 1, then Inches, the answer should be 12. But I am getting 11.99999. It should just be 12.

Is there a way to round to a certain number of decimals?

Thank you!

This is probably an error with javascript, You can use Math.round() to make sure the number is rounded.

Thanks for your response! What I think I really need is toFixed(). I tried to put it in as follows, but it didn’t work. How can I incorporate the toFixed()? Here is what I tried:

function length($value, $from, $to)
   {
       //First let's see if these units exists in our unit array.
       if (!in_array($from, $this->length_units()) || !in_array($to, $this->length_units()))
               return false;
$length = $this->get_data("length");
}
//Convert to the standart value first.
$r = $value / (float)$length[$from];
//Now convert it to the desired unit.
$r *= (float)$length[$to];
$rr = $r.toFixed(4);
//Return the new value
return $rr;

php doesn’t work that way. You have to use the php round option, there you can set the precision.

http://php.net/manual/en/function.round.php

Thank you for helping me with this Jerodev! It is kind of important, because I am in the US so we have the sticky measurement to deal with. (I wish we would just switch to metric!)

Anyway, this is what I have now, but it still doesn’t work. I don’t understand PHP very well, so I likely am just setting it up incorrectly.

function length($value, $from, $to) { //First let’s see if these units exists in our unit array. if (!in_array($from, $this->length_units()) || !in_array($to, $this->length_units())) return false;

$length = $this->get_data("length");
}
//Convert to the standart value first.
$r = $value / (float)$length[$from];
//Now convert it to the desired unit.
$r *= (float)$length[$to];
$r = round ($r, 2, PHP_ROUND_HALF_UP);
//Return the new value
return $r;

Hi,

I’ve just purchased your unit convertor, any chance you can help me embed it in wordpress page?

Thanks

  • Does this code works in wordpress? Because I test the following codes and didn’t work:

<?php require_once(“uconvert.class.php”); $c = new uconvert; ?>

//Convert 7 meter to inches. 
echo $c->length(7, "meter", "inch");

<time> <!- Base unit: day -> <day>1</day> <hour>24</hour> <milisecond>86400000</milisecond> <minute>1440</minute> <month>0.03285420944558522</month> <second>86400</second> <week>0.14285714285714285</week> <year>0.0027378507871321013</year> </time>

  • Another questions: - Can I translate the units to portuguese?

- Is it possible to insert one unit convert at time? Because in your screenshot all of them appear together….

Thanks!

This class does not work with wordpress unless you create a wordpress plugin using this class.

There is no need to translate, the plugin only provides the calculations.

by
by
by
by
by
by