You are here

function query_parameters_to_url_compute_saved_char_percentage in Query Parameters To URL 7

Computes the percentage of characters saved using an encoded string.

1 call to query_parameters_to_url_compute_saved_char_percentage()
query_parameters_to_url_admin_examples in ./query_parameters_to_url.admin.inc
Example URLs page callback.

File

./query_parameters_to_url.admin.inc, line 216
Administration pages.

Code

function query_parameters_to_url_compute_saved_char_percentage($encoded, $example) {
  return $characters_saved = round(100 - drupal_strlen($encoded) * 100 / drupal_strlen($example), 2);
}