10 Replies Latest reply on Aug 27, 2012 8:52 AM by philmodjunk

# How do i incert a decimal point?

### Title

How do i incert a decimal point?

### Post

How do i incert a decimal point into a found set that looks like this?

I know id use the getasnumber and the left functions. What is the proper syntax?

getasnumber (left ("0."  & \$adjustRateBasisNum; 2))

• ###### 1. Re: How do i incert a decimal point?

correction...

Just one zero in front

• ###### 2. Re: How do i incert a decimal point?

and what do you want the result to look like? (you don't say where you want to see the decimal point).

Is the value of this variable (It's not a found set) a number or text?

• ###### 3. Re: How do i incert a decimal point?

I want it to be 1.2658

I attempted to set the decimal point with the  "0." in this script  getasnumber (left ("0."  & \$adjustRateBasisNum; 2))

• ###### 4. Re: How do i incert a decimal point?

What about just dividing by 10000.

• ###### 5. Re: How do i incert a decimal point?

That's a great idea, but i need to check the data base. I think some of the numbers are different lengths.

• ###### 6. Re: How do i incert a decimal point?

It will help to tell us the "rules" that control where the decimal point should be.

• ###### 7. Re: How do i incert a decimal point?

The numbers are always 6 long.

Ex of the digit placement not actual numbers... Some display as 012658  and otheres 001265.

If the number is 012658 i need it to be 1.2658.

If the number is 001265 i need it to be .26580.

All of the numbers beginning with 0, or put another way none of them are actually 6 long, if i use the getasnumber function, but my found set or the field will have 6 digits in it.

That why i though of the right function but i don't know how to correctly place the decimal to get it to work.

• ###### 8. Re: How do i incert a decimal point?

I think there's a typo at just the critical point in your example

how can 001265 become .26580.  ???

Did you mean that 001265 should be 1.265?

The rule then being that the decimal is always one place to the right of the first non-zero digit?

• ###### 9. Re: How do i incert a decimal point?

It took me a bit but i have a clarification on the rule.

The rule is: take the number in the field and place a decimal 2 "spots" over.

012658 becomes 1.2658

001265 becomes .1265

Or for this application, a number greater than 1 or less than 1...

• ###### 10. Re: How do i incert a decimal point?

"two spots over" we can do. "A number greater than 1 or less than 1..." makes no sense. Except for 1, every number is already greater than 1 or less than 1 without needing to insert a decimal point like this.)

Left ( YourField ; 2 ) & "." & Right ( yourField ; Length ( YourField ) - 2 )