@Singleton public final class RoundFunction extends Object implements SoyJavaFunction, SoyJsSrcFunction, SoyPySrcFunction
| Modifier and Type | Method and Description |
|---|---|
SoyValue |
computeForJava(List<SoyValue> args)
Computes this function on the given arguments.
|
JsExpr |
computeForJsSrc(List<JsExpr> args)
Computes this function on the given arguments for the JS Source backend.
|
PyExpr |
computeForPySrc(List<PyExpr> args)
Computes this function on the given arguments for the Python Source backend.
|
String |
getName()
Gets the name of the Soy function.
|
Set<Integer> |
getValidArgsSizes()
Gets the set of valid args list sizes.
|
static long |
round(SoyValue value)
Rounds the given value to the closest integer.
|
static NumberData |
round(SoyValue value,
int numDigitsAfterPoint)
Rounds the given value to the closest decimal point left (negative numbers) or right
(positive numbers) of the decimal point
|
public String getName()
SoyFunctiongetName in interface SoyFunctionpublic Set<Integer> getValidArgsSizes()
SoyFunctiongetValidArgsSizes in interface SoyFunctionpublic SoyValue computeForJava(List<SoyValue> args)
SoyJavaFunctioncomputeForJava in interface SoyJavaFunctionargs - The function arguments.public static NumberData round(SoyValue value, int numDigitsAfterPoint)
public static long round(SoyValue value)
public JsExpr computeForJsSrc(List<JsExpr> args)
SoyJsSrcFunctioncomputeForJsSrc in interface SoyJsSrcFunctionargs - The function arguments.public PyExpr computeForPySrc(List<PyExpr> args)
SoyPySrcFunctioncomputeForPySrc in interface SoyPySrcFunctionargs - The function arguments.