diff --git a/instat/static/InstatObject/R/stand_alone_functions.R b/instat/static/InstatObject/R/stand_alone_functions.R index 66a7468bdb..f85ee657f6 100644 --- a/instat/static/InstatObject/R/stand_alone_functions.R +++ b/instat/static/InstatObject/R/stand_alone_functions.R @@ -3409,3 +3409,9 @@ check_github_repo <- function(owner = NULL, repo = NULL, url = NULL) { }) } } +#Convert Decimal to Fractions +frac10 <- function(x) {paste0(round(x * 10), "/", 10)} #Give fraction our of 10 for a decimal value +frac20 <- function(x) {paste0(round(x * 20), "/", 20)} #Give fraction our of 20 for a decimal value +frac100 <- function(x) {paste0(round(x * 100), "/", 100)} # Give fraction our of 100 for a decimal value + +frac_den <- function(x, den) {paste0(round(x * den), "/", den)} # Give fraction for a given denominator diff --git a/instat/ucrCalculator.vb b/instat/ucrCalculator.vb index f82d94a2b0..c0adc1c444 100644 --- a/instat/ucrCalculator.vb +++ b/instat/ucrCalculator.vb @@ -497,7 +497,7 @@ Public Class ucrCalculator ttCalculator.SetToolTip(cmdFrac10, "Give fraction our of 10 for a decimal value. For example for 0.36 the value is 4/10") ttCalculator.SetToolTip(cmdFrac20, "Give fraction our of 20 for a decimal value. For example for 0.36 the value is 7/20") ttCalculator.SetToolTip(cmdFrac100, "Give fraction our of 100 for a decimal value. For example for 0.36 the value is 36/100") - ttCalculator.SetToolTip(cmdFracDen, "Give fraction for a given denominator. For example for frac_den(0.36, 50) gives 18/50") + ttCalculator.SetToolTip(cmdFracDen, "Give fraction for a given denominator. For example frac_den(0.36, 50) gives 18/50") '--------------------------------------------------------------------------------------------------------------------- Const strTooltipCmdLength = "number Of observations: For example length(c(1,2,3,4,NA)) = 5 " @@ -5897,7 +5897,7 @@ Public Class ucrCalculator Private Sub cmdOrigin_Click(sender As Object, e As EventArgs) Handles cmdOrigin.Click If chkShowParameters.Checked Then - ucrReceiverForCalculation.AddToReceiverAtCursorPosition("polynom::change.origin( p= ,o= )", 6) + ucrReceiverForCalculation.AddToReceiverAtCursorPosition("polynom::change.origin(p= ,o= )", 6) Else ucrReceiverForCalculation.AddToReceiverAtCursorPosition("polynom::change.origin(, )", 3) End If