<commit_before>def discount_percentage(product)
  if product.master.msrp.present? && (product.master.msrp.to_f > 0)
    "#{((1 - product.price.to_f / product.master.msrp.to_f) * 100).round}%"
  else
    return '0%'
  end
end
<commit_msg>Added a variant discount percentage<commit_after>def discount_percentage(product)
  if product.master.msrp.present? && (product.master.msrp.to_f > 0)
    "#{((1 - product.price.to_f / product.master.msrp.to_f) * 100).round}%"
  else
    return '0%'
  end
end

def discount_percentage_variant(variant)
  if variant.msrp.present? && (variant.msrp.to_f > 0)
    "#{((1 - variant.price.to_f / variant.msrp.to_f) * 100).round}%"
  else
    return '0%'
  end
end

{'fraction_non_alphanumeric': 0.15994236311239193, 'fraction_numerical': 0.025936599423631124, 'mean_word_length': 3.727891156462585, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, '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': '2265247', 'n_tokens_mistral': 282, 'n_tokens_neox': 269, 'n_words': 49}