Using a fixed decimal when filling a currency amount input field

When entering currency amounts into an input field, I’ve seen two methods:

Keyed Decimal: The keypad includes the decimal character and the user enters the decimal along with the numbers. The Chase mobile app uses this approach.

Key  Display  5       $  5  4      $  54  .     $  54.  6    $  54.6  3   $  54.63 

Fixed Decimal: The keypad excludes the decimal character and the numbers fill around a fixed decimal. The PayPal and Square mobile apps both use this approach.

Key  Display  5    $  0.05  4    $  0.54  6    $  5.46  3   $  54.63 

The keyed decimal approach seems more straightforward to me, and it also requires 2 fewer keystrokes when entering non-decimal amounts (e.g. $ 10 only requires typing 1-0, instead of 1-0-0-0). However, users of our payment processing app have accidentally charged amounts like $ 123,456.00 instead of $ 1,234.56 because they were expecting a fixed decimal interaction instead of a keyed decimal interaction.

Is this just a matter of preference, or are there other merits to a fixed decimal approach that I may be overlooking?

Jquery and SharePoint Currency Field

I have a form with multiple SharePoint fields set as “currency”. How do I put a currency field value into a variable? I’ve tried several version, such as:

var txt01TotCash = $  ("input[id='Total_x0020_Cash__2abd298c-4fee-401a-b51a-d48afd27a395_$  CurrencyField']").text(); 

and

var txt01TotCash = $  ("input[id='Total_x0020_Cash__2abd298c-4fee-401a-b51a-d48afd27a395_$  CurrencyField']").val(); 

and

var txt01TotCash = $  ("input[title='Total Cash']").val(); 

The error I get is val is not a function or text is not a function.

Any ideas?

Thanks!

Problem with new_products section and switch currency

I have a problem on my site i have a new_products grid (Magento default) showing the last added 4 Products on my Home Page everything is working great but, my site supports two Currency, here is the problem when i click to change the currency in the header of my page the price changed everywhere execpt in this grid.

here is how we get the price on the theme

echo $  block->getProductPriceHtml($  _item, $  type); 

where $ type is ‘widget-new-grid’

I’m on Magento Comunity v3.2.3

Handling Currency getInstance throwing IllegalArgumentException

I have a class with a (simplified) method which returns a string like this :

private String doStuff(String currencyCode, BigDecimal amount){     StringBuilder sb= new StringBuilder();     NumberFormat format = NumberFormat.getInstance(Locale.FRANCE);     Currency currency = Currency.getInstance(currencyCode);      try{         format.setCurrency(currency);         sb.append(format.format(amount));     }catch(Exception e){         sb.append(amount);         logger.error(e.getMessage());     }     return sb.toString(); } 

However, we sometimes get a currencyCode which is not a supported ISO 4217 code, and Currency.getInstance(currencyCode); throws an IllegalArgumentException.

I’ve thought of 2 ways to deal with this :

  1. use a try/catch around the getInstance call
  2. check that the currencyCode is supported before

Option 1 :

private String doStuff(String currencyCode, BigDecimal amount){     StringBuilder sb= new StringBuilder();     NumberFormat format = NumberFormat.getInstance(Locale.FRANCE);     Currency currency = null;      try {         currency = Currency.getInstance(currencyCode);     } catch (IllegalArgumentException iae) {         iae.printStackTrace();     }     ... } 

Option 2 :

private static Set<String> currencies = initCurrencies();  private static Set<String> initCurrencies() {     Set<String> currencies = new HashSet<>();     for (Currency c : Currency.getAvailableCurrencies()) {         currencies.add(c.getCurrencyCode());     }     return currencies; }  private String doStuff(String currencyCode, BigDecimal amount){     StringBuilder sb= new StringBuilder();     NumberFormat format = NumberFormat.getInstance(Locale.FRANCE);     Currency currency = null;      if (currencies.contains(currencyCode)) {         currency = Currency.getInstance(currencyCode);     }     ... } 

Which is better ?

I am looking for a json query to format Currency column in SharePoint Online

I am looking for a json query to format Currency column in SharePoint Online. Below query works but removes currency icon from the value.

{ “$ schema”: “http://columnformatting.sharepointpnp.com/columnFormattingSchema.json”, “elmType”: “div”, “style”: { “font-weight”: “bold”, “background-color”: “yellow” }, “txtContent”: “@currentField” }

$20,000 In 1 Month Trading Currency Online Make Money Online Currency Trading

Race Option: https://secure.raceoption.com/tiny/dNeIk Follow the steps below to learn how to get started with binary options and how to use and apply my working martingale strategy. I made this to show you step-by-step how to make money from binary options. If you follow my strategy to the…

$ 20,000 In 1 Month Trading Currency Online Make Money Online Currency Trading

$20,000 In 1 Month Trading Currency Online Make Money Online Currency Trading

Race Option: https://secure.raceoption.com/tiny/dNeIk Follow the steps below to learn how to get started with binary options and how to use and apply my working martingale strategy. I made this to show you step-by-step how to make money from binary options. If you follow my strategy to the…

$ 20,000 In 1 Month Trading Currency Online Make Money Online Currency Trading