1. def self.convert_bd_in_hash(hash)
  2. hash.each do |k, v|
  3. if v.is_a?(BigDecimal)
  4. val = v.to_s('f')
  5. v = val # <---- i need THIS to somehow modify the original hash value
  6. elsif v.is_a?(Hash)
  7. convert_bd_in_hash v
  8. elsif v.is_a?(Array)
  9. v.flatten.each { |x| convert_bd_in_hash(x) if x.is_a?(Hash) }
  10. end
  11. end
  12. return hash
  13. end