<commit_before>const getUnderlyingPipSize = require('../pages/trade/symbols').getUnderlyingPipSize;
const addComma             = require('../../_common/base/currency_base').addComma;

const changePocNumbersToString = (response) => {
    const {
        barrier,
        current_spot,
        entry_spot,
        entry_tick,
        exit_tick,
        sell_price,
        sell_spot,
        profit_percentage,
    } = response.proposal_open_contract;

    return new Promise((resolve) => {
        getUnderlyingPipSize(response.proposal_open_contract.underlying).then(pip_size => {
            const toString = (property, decimal_places = pip_size) => (
                property || property === 0 ? addComma(property, decimal_places) : undefined
            );

            resolve($.extend({}, {
                ...response,
                proposal_open_contract: {
                    ...response.proposal_open_contract,
                    barrier          : barrier ? addComma(barrier, pip_size) : undefined, // Because `barrier` must not be displayed when zero
                    sell_price       : toString(sell_price),
                    sell_spot        : toString(sell_spot),
                    current_spot     : toString(current_spot),
                    entry_spot       : toString(entry_spot),
                    entry_tick       : toString(entry_tick),
                    exit_tick        : toString(exit_tick),
                    profit_percentage: toString(profit_percentage, 2),
                },
            }));
        });
    });
};

module.exports = {
    changePocNumbersToString,
};<commit_msg>Fixed barrier display issue<commit_after>const getUnderlyingPipSize = require('../pages/trade/symbols').getUnderlyingPipSize;
const addComma             = require('../../_common/base/currency_base').addComma;

const changePocNumbersToString = (response) => {
    const {
        barrier,
        current_spot,
        entry_spot,
        entry_tick,
        exit_tick,
        sell_price,
        sell_spot,
        profit_percentage,
    } = response.proposal_open_contract;

    return new Promise((resolve) => {
        getUnderlyingPipSize(response.proposal_open_contract.underlying).then(pip_size => {
            const toString = (property, decimal_places = pip_size) => (
                property || property === 0 ? addComma(property, decimal_places) : undefined
            );

            resolve($.extend({}, {
                ...response,
                proposal_open_contract: {
                    ...response.proposal_open_contract,
                    barrier          : barrier ? addComma(barrier) : undefined, // Because `barrier` must not be displayed when zero
                    sell_price       : toString(sell_price),
                    sell_spot        : toString(sell_spot),
                    current_spot     : toString(current_spot),
                    entry_spot       : toString(entry_spot),
                    entry_tick       : toString(entry_tick),
                    exit_tick        : toString(exit_tick),
                    profit_percentage: toString(profit_percentage, 2),
                },
            }));
        });
    });
};

module.exports = {
    changePocNumbersToString,
};
{'fraction_non_alphanumeric': 0.09981572481572482, 'fraction_numerical': 0.0012285012285012285, 'mean_word_length': 1.7485232067510548, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '1077816', 'n_tokens_mistral': 862, 'n_tokens_neox': 835, 'n_words': 138}