Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Displaying p values without leading zero

    Is there a format option (or a trick) to display numbers like 0.03 without the leading zero? That is, as .03? Some journals require p values to be displayed without the leading zero. It's no problem when writing a text, but it is a problem when displaying p values in figures, for example using caption option with p value being a local macro. Any other solution then using graph editor?
    Andrzej
    Last edited by Andrzej Niemierko; 25 Oct 2017, 11:57.

  • #2
    Does this help? (Otherwise we sorely and surely need a context of where the P-values are coming from and how they are provided.)

    Code:
    . local have "0.001"
    
    . local want = substr("`have'", 2, .)
    
    . di "`want'"
    .001

    Comment


    • #3
      Thanks Nick, indeed that's what I needed. The p values (from log-rank test) are calculated on the fly in a loop and used in figures as local macros.

      Comment

      Working...
      X