Lua inputbox: Allow negative values and floating point input. Unfinished, has problems of display (mouse cursor cleaning, display cleaning and alignment, removing redundant digits like in 15.000)
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1354 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
9
misc.c
9
misc.c
@@ -24,6 +24,7 @@
|
||||
#include <string.h>
|
||||
#include <strings.h>
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
#include "struct.h"
|
||||
#include "sdlscreen.h"
|
||||
#include "global.h"
|
||||
@@ -811,6 +812,14 @@ int Max(int a,int b)
|
||||
return (a>b)?a:b;
|
||||
}
|
||||
|
||||
/* Round number n to d decimal points */
|
||||
double Fround(double n, unsigned d)
|
||||
{
|
||||
double exp;
|
||||
exp = pow(10.0, d);
|
||||
return floor(n * exp + 0.5) / exp;
|
||||
}
|
||||
|
||||
|
||||
// Fonction retournant le libellé d'une mode (ex: " 320x200")
|
||||
char * Mode_label(int mode)
|
||||
|
||||
Reference in New Issue
Block a user