module function · N/currency

exchangeRate()

currency.exchangeRate(options)

Returns an exchange rate between two currencies.

Implementation
Not started
Design
Open for proposals suggest how it should read
Proposals
A
Signature
currency.exchangeRate(options)
Returns
number
Governance
10 units
Script types
Client and server scripts
Version
SuiteScript 2.x, documented for 2.1; since NetSuite 2015.2
call shapefrom Oracle's parameter table
1currency.exchangeRate({2    date:   /* Date, optional */,3    source: /* number | string, required */,4    target: /* number | string, required */5});
Oracle reference for this method
ParameterTypeRequiredDescription
options.dateDateoptionalPass in a new Date object. For example, date: new Date('7/28/2015') If date is not specified, then it defaults to today (the current date). The date determines the exchange rate in effect. If there are multiple rates, it is the latest entry on that date. Use the same date format as your NetSuite account.
options.sourcenumber | stringrequiredThe internal ID or three-letter ISO code for the currency you are converting from. For example, you can use either 1 (internal ID) or USD (currency code). If the Multiple Currencies feature is enabled, you can view a list of all the currency internal IDs and ISO codes at Lists > Accounting > Currencies .
options.targetnumber | stringrequiredThe internal ID or three-letter ISO code for the currency you are converting to.
B

No Mynt syntax yet.

Nothing in the language compiles to currency.exchangeRate(options) today. How should it read?

C

Competing syntax for exchangeRate, from GitHub Discussions. Select two or more to compare them side by side.

All discussions

Loading proposals from GitHub…

D

Write the Mynt you wish you could write.

A good proposal shows the syntax, the SuiteScript it should become, and argues for it: why it is clearer, how it fits the rest of the language, what it makes harder.

  • Clarity. Does it say what happens, without ceremony?
  • Consistency. Does it read like load, save and Ref[field]?
  • Expressiveness. Does it cover the cases people actually write?
  • Honesty. Does it hide a NetSuite cost, such as governance, that a reader should see?

N/currency · currency.exchangeRate(options)

Suggest syntax for exchangeRate