you21979 / node-ripple-trade-helper

MIT License
5 stars 0 forks source link

通貨計算はamountに移行したい #12

Open you21979 opened 9 years ago

you21979 commented 9 years ago
/**
 * Calculate a product of two amounts.
 *
 * This function allows you to calculate a product between two amounts which
 * retains XRPs human/external interpretation (i.e. 1 XRP = 1,000,000 base
 * units).
 *
 * Intended use is to calculate something like: 10 USD * 10 XRP/USD = 100 XRP
 *
 * @example
 *   var sell_amount = buy_amount.product_human(price);
 *
 * @see Amount#ratio_human
 *
 * @this {Amount} The first factor of the product.
 * @param {Amount} factor The second factor of the product.
 * @param opts Options for the calculation.
 * @param opts.reference_date {Date|Number} Date based on which demurrage/interest
 *   should be applied. Can be given as JavaScript Date or int for Ripple epoch.
 * @return {Amount} The product. Unit will be the same as the first factor.
 */
Amount.prototype.product_human = function(factor, opts) {