<commit_before>/*!
 * jquery-toCurrency Plugin for jQuery
 *
 * Version 0.1.1
 *
 * Copyright 2012, <NAME>
 * Licensed under the MIT license.
 */ 
(function( $ ){
	"use strict";
	$.toCurrency = function( val, opts ) {
		var val_str, reverse_whole_part, decimals, i,
				sign = "",
				whole_part = "",
				default_options = {
					precision: 2,
					delimiter: ",",
					separator: ".",
					unit: "&euro;",
					format: "%u %n",
					negativeFormat: false
				};
		opts = $.extend( default_options, opts );

		val = parseFloat(val);
		if( isNaN(val) ) {
			throw new Error( "toCurrency error: invalid number format " + val );
		}
		if ( val < 0 ) {
			sign = "-";
		}

		val_str = val.toFixed( opts.precision ).replace( "-", "" );
		reverse_whole_part = val_str.split(".")[0].split("").reverse().join("");
		decimals = ( opts.precision > 0 ? opts.separator : "" ) + ( val_str.split(".")[1] || "" );
				
		for ( i = 0; i < reverse_whole_part.length; i++ ) {
			if ( i % 3 === 0 && i !== 0 ) {
				whole_part += opts.delimiter;
			}
			whole_part += reverse_whole_part.charAt(i);
		}
		whole_part = whole_part.split("").reverse().join("");
		
		if ( sign === "-" && opts.negativeFormat ) {
			return opts.negativeFormat.replace( "%n", whole_part + decimals ).replace( "%u", opts.unit );
		} else {
			return opts.format.replace( "%n", sign + whole_part + decimals ).replace( "%u", opts.unit );
		}
	};
	
	$.fn.toCurrency = function( options ) {
		return this.each(function() {
			$(this).html( $.toCurrency( $(this).text(), options ) );
		});
	};
})( jQuery );<commit_msg>tab to spaces (github, y u no use tab width = 2?)<commit_after>/*!
 * jquery-toCurrency Plugin for jQuery
 *
 * Version 0.1.1
 *
 * Copyright 2012, <NAME>
 * Licensed under the MIT license.
 */ 
(function( $ ){
  "use strict";
  $.toCurrency = function( val, opts ) {
    var val_str, reverse_whole_part, decimals, i,
        sign = "",
        whole_part = "",
        default_options = {
          precision: 2,
          delimiter: ",",
          separator: ".",
          unit: "&euro;",
          format: "%u %n",
          negativeFormat: false
        };
    opts = $.extend( default_options, opts );

    val = parseFloat(val);
    if( isNaN(val) ) {
      throw new Error( "toCurrency error: invalid number format " + val );
    }
    if ( val < 0 ) {
      sign = "-";
    }

    val_str = val.toFixed( opts.precision ).replace( "-", "" );
    reverse_whole_part = val_str.split(".")[0].split("").reverse().join("");
    decimals = ( opts.precision > 0 ? opts.separator : "" ) + ( val_str.split(".")[1] || "" );
        
    for ( i = 0; i < reverse_whole_part.length; i++ ) {
      if ( i % 3 === 0 && i !== 0 ) {
        whole_part += opts.delimiter;
      }
      whole_part += reverse_whole_part.charAt(i);
    }
    whole_part = whole_part.split("").reverse().join("");
    
    if ( sign === "-" && opts.negativeFormat ) {
      return opts.negativeFormat.replace( "%n", whole_part + decimals ).replace( "%u", opts.unit );
    } else {
      return opts.format.replace( "%n", sign + whole_part + decimals ).replace( "%u", opts.unit );
    }
  };
  
  $.fn.toCurrency = function( options ) {
    return this.each(function() {
      $(this).html( $.toCurrency( $(this).text(), options ) );
    });
  };
})( jQuery );
{'fraction_non_alphanumeric': 0.19412477286493035, 'fraction_numerical': 0.009993943064809207, 'mean_word_length': 2.5592672413793105, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7649718', 'n_tokens_mistral': 1236, 'n_tokens_neox': 1103, 'n_words': 254}