<commit_before>'use strict';

var React = require('react');

var MoneyInput = React.createClass({
  propTypes: {
    setAmount: React.PropTypes.func.isRequired,
    defaultAmount: React.PropTypes.number
  },

  getInitialState: function() {
    return {
      amount: 0,
      amountString: ""
    };
  },

  setAmount: function(e) {
    var trimmedString = e.target.value.replace(/\.[\s0]*$/, "").replace(/$|,/,"");
    var floatValue = Math.abs(parseFloat(trimmedString));

    if (floatValue.toFixed(2).replace(/\.?0+$/, "") === trimmedString) {
      this.setState({
        amountString: e.target.value,
        amount: Math.round(floatValue*100)
      }, function() {
        this.props.setAmount(Math.round(floatValue*100));

      });

    } else if (trimmedString === "") {
      this.setState({<commit_msg>Blank line removed<commit_after>'use strict';

var React = require('react');

var MoneyInput = React.createClass({
  propTypes: {
    setAmount: React.PropTypes.func.isRequired,
    defaultAmount: React.PropTypes.number
  },

  getInitialState: function() {
    return {
      amount: 0,
      amountString: ""
    };
  },

  setAmount: function(e) {
    var trimmedString = e.target.value.replace(/\.[\s0]*$/, "").replace(/$|,/,"");
    var floatValue = Math.abs(parseFloat(trimmedString));

    if (floatValue.toFixed(2).replace(/\.?0+$/, "") === trimmedString) {
      this.setState({
        amountString: e.target.value,
        amount: Math.round(floatValue*100)
      }, function() {
        this.props.setAmount(Math.round(floatValue*100));
      });

    } else if (trimmedString === "") {
      this.setState({
{'fraction_non_alphanumeric': 0.1784841075794621, 'fraction_numerical': 0.012224938875305624, 'mean_word_length': 2.9926829268292683, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2024843', 'n_tokens_mistral': 543, 'n_tokens_neox': 519, 'n_words': 85}