Skip to content

Commit

Permalink
adding standalone functions
Browse files Browse the repository at this point in the history
  • Loading branch information
Fidel365 committed Oct 14, 2024
1 parent 3513212 commit 8c0b88b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions instat/static/InstatObject/R/stand_alone_functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions instat/ucrCalculator.vb
Original file line number Diff line number Diff line change
Expand Up @@ -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 "
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 8c0b88b

Please sign in to comment.