function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
MERMMERM 

Number to Words Function

I need to creat a field based on another field (numeric) that is the numeric value in words. 

 

For example if the numeric field is "2" then the new field would be "two", "315" would yield "Three Hundred and Fifteen".

 

What is the best way to go about this?  I'm not looking for an algorythm here, I already know how to code this.  I'm looking for a way to implement it in SalesForce.

 

Formulars don't have loops or vaiables, so it looks like that would be very difficult to code.  Is there a way to do this in perl (that's what my original code is written in), or python, ruby, or even C?  

 

Where should I look for this?  Is it alredy implemented?

 

Matt

sfdcfoxsfdcfox

Formulas could (theortically) handle smaller sets of numbers, but would fall short for really big numbers. Your best choice would be Apex Code (as a trigger, for example). The source field would be a number, as you'd expect, and the destination field would be a regular text field, set as "read only" for users. Then, your trigger would go through the process of converting the number into words upon saving the record. Apex Code resembles Java in nature, and has similar capabilies, including RegEx and a full String library. If you need some help, let us know, we'd be glad to point you in the right direction.

AnithaCRMAnithaCRM

Hi I kneed help with this same requirement .

I need the currency Format in INR.

Can you help mw with sampple code.

 

Sushant ChavanSushant Chavan

Hi,

Even I am looking for a similar solution for Indian curreny. Has anybody cracked it ?