Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add signum interpolation function #4854

Merged
merged 1 commit into from
Feb 7, 2016

Conversation

jfromaniello
Copy link
Contributor

This function returns -1 for negative numbers, 0 for 0 and 1 for positive numbers.

Useful when you need to set a value for the first resource and a different value for the rest of the resources.

Example: ${element(split(",", var.r53_failover_policy), signum(count.index))}

This closes the issue #4853 reported previously by myself.

This function returns -1 for negative numbers, 0 for 0 and 1 for positive numbers.

Useful when you need to set a value for the first resource and a different value for the rest of the resources.

Example: `${element(split(",", var.r53_failover_policy), signum(count.index))}`
* `signum(int)` - Returns -1 for negative numbers, 0 for 0 and 1 for positive numbers.
This function is useful when you need to set a value for the first resource and
a different value for the rest of the resources.
Example: `element(split(",", var.r53_failover_policy), signum(count.index))`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you mind also mentioning the example from the issue? I think that would help users to better understand possible use-cases of this function.

i.e. I'd change this

Example: element(split(",", var.r53_failover_policy), signum(count.index))

to

Example: element(split(",", var.r53_failover_policy), signum(count.index)) where the zeroth index points to PRIMARY and 1st to FAILOVER

@radeksimko
Copy link
Member

Except one nitpick in docs this LGTM.

@radeksimko radeksimko added the waiting-response An issue/pull request is waiting for a response from the community label Jan 30, 2016
@radeksimko
Copy link
Member

Merging this, I will update the docs in a separate commit.

Thanks for the PR!

radeksimko added a commit that referenced this pull request Feb 7, 2016
@radeksimko radeksimko merged commit 4edf782 into hashicorp:master Feb 7, 2016
@radeksimko radeksimko removed the waiting-response An issue/pull request is waiting for a response from the community label Feb 7, 2016
@jfromaniello
Copy link
Contributor Author

Thanks a lot!

@ghost
Copy link

ghost commented Apr 28, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants