Consideration Formula for Deeds

Discussions related to ReadyDoc development.
Post Reply
hcastaneda
Posts: 7
Joined: Fri Feb 17, 2023 11:19 am

Consideration Formula for Deeds

Post by hcastaneda »

We have an attorney that wants the wording on the Deed to be Two Hundred Sixty-Five Thousand Dollars And No/100 Cents ($265,000.00). The formula I have is <CALC TC (DollarWords({{.ConsiderationAmount}}))> DOLLARS (${{.ConsiderationAmount}}) Which reads Two Hundred Sixty-Five Thousand And No/100 Dollars ($265,000.00) Is there a way to add Dollars after the dollar amount and before the No/100?
BobRichards
Posts: 1376
Joined: Wed Jan 15, 2014 3:50 pm
Location: Raleigh, NC
Contact:

Re: Consideration Formula for Deeds

Post by BobRichards »

I do not have a way to work with the document but perhaps you can experiment with the following functions. We will use the amount of $150.22 for these examples.

The WORDSC function removes the fractional dollars and prints only the whole dollar amount.
{{order.SalesContract.SalesPrice WORDSC}} generates "one hundred fifty"

In this example, we want to print the fractional dollars (cents). The SubString function takes a string and returns all characters starting at the third character and as many characters as specified in the third parameter. We specified "0" for this value so SubString returns all characters starting with character 3.
SubString(DollarWords(DecimalPart({{order.SalesContract.SalesPrice}})), 3, 0) generates " dollars and 22/100"

Breakdown...
{{order.SalesContract.SalesPrice}} = 150.22

(Take the decimal part so the dollars part of the result string will always start with "No dollars" so we can remove the constant word "No" later.)
DecimalPart({{order.SalesContract.SalesPrice}}) = 0.22
(DollarWords(DecimalPart({{order.SalesContract.SalesPrice}})) = "No dollars and 22/100"


(Remove the word "No")
SubString(DollarWords(DecimalPart({{order.SalesContract.SalesPrice}})), 3, 0) = " dollars and 22/100"
(Notice that we included the space before the word "dollars". If we wanted to remove the space, change the "3" to "4")

Let me know what you come up with.
Bob Richards, Senior Software Developer, SoftPro
hcastaneda
Posts: 7
Joined: Fri Feb 17, 2023 11:19 am

Re: Consideration Formula for Deeds

Post by hcastaneda »

This is what I got to work. Thanks so much for your help!!
<CALC TC (NumericWords({{.ConsiderationAmount}}))><CALC TC (SubString(DollarWords(DecimalPart({{.ConsiderationAmount}})), 3, 0))> CENTS (${{.ConsiderationAmount}})
It gives me this
Three Hundred Fifty Thousand Dollars And No/100 CENTS ($350,000.00)
I have an extra space between Thousand and Dollars but other than that it's perfect!
BobRichards
Posts: 1376
Joined: Wed Jan 15, 2014 3:50 pm
Location: Raleigh, NC
Contact:

Re: Consideration Formula for Deeds

Post by BobRichards »

Try changing the "3" to "4" to remove the extra space.

Code: Select all

<CALC TC (NumericWords({{.ConsiderationAmount}}))><CALC TC (SubString(DollarWords(DecimalPart({{.ConsiderationAmount}})), 4, 0))> CENTS (${{.ConsiderationAmount}})
In our case, the SubString function takes the input string and cuts off the beginning characters. The DollarWords(DecimalPart({{.ConsiderationAmount}})) function produces the string below. (I added the beginning and ending double-quotes to wrap the string contents. I have also numbered the character positions that we can pass to SubString.)

Code: Select all

"No dollars and NO/100"
 123456789012345678901
          111111111122
When we pass the "3" to SubString, we are saying that we want to return the input string STARTING with the third character. As we can see above the third character is a space. If you don't want the space, you can tell SubString to start with position "4" and it will return starting with the "d" in "dollars". Now that I think about it, if you only wanted the cents part, you could have passed starting position "16" to SubString. Lots of options!

Thanks for providing your response! It will be a big help to people with the same question later and I can provide your code as an answer.
Bob Richards, Senior Software Developer, SoftPro
hcastaneda
Posts: 7
Joined: Fri Feb 17, 2023 11:19 am

Re: Consideration Formula for Deeds

Post by hcastaneda »

That worked perfectly! Thanks for all your help!
Post Reply