Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Wynn
purr-data
Commits
42418dec
Commit
42418dec
authored
May 31, 2018
by
Pranay Gupta
Browse files
support for converting double values to nbx display string added
parent
c7a99e64
Changes
1
Show whitespace changes
Inline
Side-by-side
pd/src/g_numbox.c
View file @
42418dec
...
...
@@ -13,6 +13,12 @@
#include <math.h>
#define IEM_GUI_COLOR_EDITED 0xff0000
#if PD_FLOATSIZE == 32
#define MY_NUMBOX_FLOAT_SPECIFIER "%.6g"
#elif PD_FLOATSIZE == 64
#define MY_NUMBOX_FLOAT_SPECIFIER "%.14lg"
#endif
extern
int
gfxstub_haveproperties
(
void
*
key
);
static
void
my_numbox_draw_select
(
t_my_numbox
*
x
,
t_glist
*
glist
);
static
void
my_numbox_key
(
void
*
z
,
t_floatarg
fkey
);
...
...
@@ -64,7 +70,7 @@ void my_numbox_ftoa(t_my_numbox *x)
double
f
=
x
->
x_val
;
int
bufsize
,
is_exp
=
0
,
i
,
idecimal
;
sprintf
(
x
->
x_buf
,
"%g"
,
f
);
sprintf
(
x
->
x_buf
,
MY_NUMBOX_FLOAT_SPECIFIER
,
f
);
bufsize
=
strlen
(
x
->
x_buf
);
if
(
bufsize
>=
5
)
/* if it is in exponential mode */
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment