Q:

Making transaction with web3.js sometime it make success and some time it gives errors

When we are making any transaction then we need gas for every transaction so how much gas i fixed to making  successful transactions because some time transaction is successful and some time give it error 
"Error: Returned error: insufficient funds for gas * price + value"
Thanks in advance .

exports.sendTransactions = (sender_account, to_account, p_key, value ) => {
  console.log("sendTRansactions", sender_account,  to_account , p_key , value );
  var admin = sender_account;
  var contract_address = to_account;
  var tx = {
    from: admin,
    to: contract_address,
    gas: 184000,
    data: "",
    value: value
  };
   return web3.eth.accounts.signTransaction(tx, p_key).then((hash) => {
     return web3.eth.sendSignedTransaction(hash.rawTransaction).then((receipt) => {
       return receipt
    }, (error) => {
      return error
      console.log(error);
      // reject(500);
    })
  }, (error) => {
    return error
    // reject(500);
  });
}

A:

I just made gas is in string example:
    gas: '184000',
and it working for me. 

