Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

i have a calculated result

field named FINAL - RESULT is 1.1 desired result " i want is 1.5 with script for example using if substitue and result ??? "

for example im writing script forgive typographical errors

if

(

right(final;1)>1andright(final;1)<5

;

.5 ( i want .1 to be replaced by .5 )

;

final

)

many times we do complex calculations sometimes small1s doesnt bright up the spark ;( may be due non stop designing my brain hung up

im going wrong somewhere my medical brain couldnt find it out please help me :(

I am having great difficulty understanding your question.

What type of field is final? It appears to be a Number field - and in such case a numerical calculation would seem more appropriate than the text functions you are  attempting to use.

Also you say (I think?) that an input of 1.1 should result in 1.5. But then you have the condition of right(final;1)>1 which the value of 1.1 does not meet.

A better explanation of the rule, along with a few examples, would be useful.

 

3 hours ago, Gopala Krishnam Raju Ambati said:

many times we do complex calculations sometimes small1s doesnt bright up the spark ;( may be due non stop designing my brain hung up

Make a custom function to tailor each fraction into a desired result:

Pease note that I use commas where you probably would use punctuations, for showing where the decimal part starts...

--sd

Skærmbillede 2024-06-18 kl. 23.05.45.png

  • Author

final filed is number field

i am trying to script final filed whose value is 1.2 but i want it to be 1.5 

im trying to do without custom functions is it possible ??

2024-06-19 05_43_41-HOMEPAGE-1 - TABLE NAME - HOMEPAGE - RECORDS FOUND-1 - TOTAL RECORDS-1 - WEEK-25.png

Edited by Gopala Krishnam Raju Ambati

I must ask, why script? It’s to me a calc?

—sd

29 minutes ago, Gopala Krishnam Raju Ambati said:

value is 1.2 but i want it to be 1.5 

That does not provide a sufficient explanation. If you're unable to formulate a clear rule, at least provide the expected output for all of these input values:

1.0 
1.1
1.2
1.3
1.4
1.5
1.6
1.7
1.8
1.9
2.0 

 

 

 

  • Author

oops i will explain

 

i made a calculation and  final result i got is 1.2 i want a calculation step so that  new filed final 2  should display as 1.5 if decimal is in between .1 to .4

 

hope i explained properly ??

10 minutes ago, Gopala Krishnam Raju Ambati said:

hope i explained properly ??

Not really. Because we still don't know what the result should be when the decimal is below .1 or above .4.

I am guessing (!) you want to do something like:

Let ( [
r = Mod ( final ; 1 )
] ;
Int ( final ) + If ( 0 < r and r < 0.5 ; 0.5 ; r )
)

which would give the following results in my example:

1.0 ==> 1.0
1.1 ==> 1.5
1.2 ==> 1.5
1.3 ==> 1.5
1.4 ==> 1.5
1.5 ==> 1.5
1.6 ==> 1.6
1.7 ==> 1.7
1.8 ==> 1.8
1.9 ==> 1.9
2.0 ==> 2.0

 

  • Author

thanks will check

 

Edited by Gopala Krishnam Raju Ambati

24 minutes ago, Gopala Krishnam Raju Ambati said:

as im from science background as math's doesn't easily penetrates my brain

Isn't math the language of science?

Anyway, 0 < r means that r  (the decimal part) is greater than 0.

 

Edited by comment

15 hours ago, comment said:

Not really. Because we still don't know what the result should be when the decimal is below .1 or above .4.

I am guessing (!) you want to do something like:

Let ( [
r = Mod ( final ; 1 )
] ;
Int ( final ) + If ( 0 < r and r < 0.5 ; 0.5 ; r )
)

which would give the following results in my example:

1.0 ==> 1.0
1.1 ==> 1.5
1.2 ==> 1.5
1.3 ==> 1.5
1.4 ==> 1.5
1.5 ==> 1.5
1.6 ==> 1.6
1.7 ==> 1.7
1.8 ==> 1.8
1.9 ==> 1.9
2.0 ==> 2.0

 

Could also be written this way:

Let(    tt = final ;    Choose(       Min( Mod( tt; 1 ) * 10; 5 );       tt & ",0";       Int(tt) + 0,5;Int(tt) + 0,5;Int(tt) + 0,5;Int(tt) + 0,5;       tt    ) )

(if being outside europe substitute commas with punctuations...)

--sd

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.