June 18, 20241 yr 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 :(
June 18, 20241 yr 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.
June 18, 20241 yr 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
June 19, 20241 yr 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 ?? Edited June 19, 20241 yr by Gopala Krishnam Raju Ambati
June 19, 20241 yr 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
June 19, 20241 yr 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 ??
June 19, 20241 yr 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
June 19, 20241 yr 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 June 19, 20241 yr by comment
June 19, 20241 yr 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